Class NotBlankValidator
java.lang.Object
org.hibernate.validator.internal.constraintvalidators.hv.NotBlankValidator
- All Implemented Interfaces:
ConstraintValidator<NotBlank,CharSequence>
Check that a character sequence's (e.g. string) trimmed length is not empty.
- Author:
- Hardy Ferentschik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext) Checks that the trimmed string is not empty.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.validation.ConstraintValidator
initialize
-
Constructor Details
-
NotBlankValidator
public NotBlankValidator()
-
-
Method Details
-
isValid
public boolean isValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext) Checks that the trimmed string is not empty.- Specified by:
isValidin interfaceConstraintValidator<NotBlank,CharSequence> - Parameters:
charSequence- the character sequence to validateconstraintValidatorContext- context in which the constraint is evaluated- Returns:
- returns
trueif the string isnullor the length of the trimmedcharSequenceis strictly superior to 0,falseotherwise
-