T
- The type to constrain@FunctionalInterface public interface SizeValidator<T> extends ConstraintValidator<javax.validation.constraints.Size,T>
Size
validator.VALID
Modifier and Type | Method and Description |
---|---|
int |
getSize(T value)
Evaluate the size for the given value.
|
default boolean |
isValid(T value,
AnnotationValue<javax.validation.constraints.Size> annotationMetadata,
ConstraintValidatorContext context)
Implements the validation logic.
|
isValid
default boolean isValid(@Nullable T value, @NonNull AnnotationValue<javax.validation.constraints.Size> annotationMetadata, @NonNull ConstraintValidatorContext context)
ConstraintValidator
Implementations should be thread-safe and immutable.
value
- object to validateannotationMetadata
- The annotation metadatacontext
- The context objectfalse
if value
does not pass the constraintint getSize(@NonNull T value)
value
- The value