Class NotBlankValidator

    • Constructor Detail

      • NotBlankValidator

        public NotBlankValidator()
    • Method Detail

      • isValid

        public boolean isValid​(CharSequence charSequence,
                               ConstraintValidatorContext constraintValidatorContext)
        Checks that the character sequence is not null nor empty after removing any leading or trailing whitespace.
        Specified by:
        isValid in interface ConstraintValidator<NotBlank,​CharSequence>
        Parameters:
        charSequence - the character sequence to validate
        constraintValidatorContext - context in which the constraint is evaluated
        Returns:
        returns true if the string is not null and the length of the trimmed charSequence is strictly superior to 0, false otherwise