Top Description Constructors Methods
org.hibernate.validator.internal.constraintvalidators.hv

public Class NotBlankValidator

extends Object
implements ConstraintValidator<NotBlank, CharSequence>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Annotations
@SuppressWarnings:deprecation
Imports
jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, org.hibernate.validator.constraints.NotBlank

Check that a character sequence's (e.g. string) trimmed length is not empty.
Author
Hardy Ferentschik

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

returns true if the string is null or the length of the trimmed charSequence is strictly superior to 0, false otherwise
isValid
(CharSequence
the character sequence to validate
charSequence
,
ConstraintValidatorContext
context in which the constraint is evaluated
constraintValidatorContext
)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks that the trimmed string is not empty.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NotBlankValidatorback to summary
public NotBlankValidator()

Method Detail

isValidback to summary
public boolean isValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks that the trimmed string is not empty.

Parameters
charSequence:CharSequence

the character sequence to validate

constraintValidatorContext:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

returns true if the string is null or the length of the trimmed charSequence is strictly superior to 0, false otherwise

Annotations
@Override