Class SizeValidator<T>

    • Field Detail

      • min

        protected int min
      • max

        protected int max
    • 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 interface jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Size,​T>
        Parameters:
        constraint - the constraint definition
      • isValid

        public boolean isValid​(T value,
                               jakarta.validation.ConstraintValidatorContext context)
        Specified by:
        isValid in interface jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Size,​T>