Class NotEmptyValidatorForCollection
java.lang.Object
org.hibernate.validator.internal.constraintvalidators.bv.notempty.NotEmptyValidatorForCollection
- All Implemented Interfaces:
ConstraintValidator<NotEmpty,Collection>
public class NotEmptyValidatorForCollection
extends Object
implements ConstraintValidator<NotEmpty,Collection>
Check that the collection is not null and not empty.
- Author:
- Guillaume Smet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(Collection collection, ConstraintValidatorContext constraintValidatorContext) Checks the collection is notnulland 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
-
NotEmptyValidatorForCollection
public NotEmptyValidatorForCollection()
-
-
Method Details
-
isValid
public boolean isValid(Collection collection, ConstraintValidatorContext constraintValidatorContext) Checks the collection is notnulland not empty.- Specified by:
isValidin interfaceConstraintValidator<NotEmpty,Collection> - Parameters:
collection- the collection to validateconstraintValidatorContext- context in which the constraint is evaluated- Returns:
- returns
trueif the collection is notnulland the collection is not empty
-