ruleForComparable 的 BUG
#14
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
当被校验的
value的类型,其实现的Comparable的泛型是其父类型时,无法指定具体类型的类型参数以
LocalDateTime为例,LocalDateTime实现了ChronoLocalDateTime,间接实现了Comparable<ChronoLocalDateTime>,此时无法使用this.<LocalDateTime>ruleForComparable(xxx)的方式定义LocalDateTime的校验规则。MapValidator中,不指定类型参数的情况下,使用must定义规则时,lambda 表达式的入参被识别为Comparable<T>,而非具体LocalDateTime类型BaseValidator中,不指定类型参数的情况下,使用must定义规则时,lambda 表达式的入参被识别为ChronoLocalDateTime<?>,而非具体LocalDateTime类型