Package org.apache.bval.constraints
Class SizeValidator<T>
- java.lang.Object
-
- org.apache.bval.constraints.SizeValidator<T>
-
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Size,T>
- Direct Known Subclasses:
SizeValidator.ForArray
,SizeValidator.ForCharSequence
,SizeValidator.ForCollection
,SizeValidator.ForMap
public abstract class SizeValidator<T> extends Object implements jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Size,T>
Description: Abstract validator impl. for @Size annotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SizeValidator.ForArray<T>
static class
SizeValidator.ForCharSequence
static class
SizeValidator.ForCollection
static class
SizeValidator.ForMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
SizeValidator(ToIntFunction<? super T> sizeOf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(jakarta.validation.constraints.Size constraint)
Configure the constraint validator based on the elements specified at the time it was defined.boolean
isValid(T value, jakarta.validation.ConstraintValidatorContext context)
-
-
-
Constructor Detail
-
SizeValidator
protected SizeValidator(ToIntFunction<? super T> sizeOf)
-
-
Method Detail
-
initialize
public void initialize(jakarta.validation.constraints.Size constraint)
Configure the constraint validator based on the elements specified at the time it was defined.- Specified by:
initialize
in interfacejakarta.validation.ConstraintValidator<jakarta.validation.constraints.Size,T>
- Parameters:
constraint
- the constraint definition
-
-