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
类型