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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid
(Collection collection, ConstraintValidatorContext constraintValidatorContext) Checks the collection is notnull
and not empty.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 notnull
and not empty.- Specified by:
isValid
in interfaceConstraintValidator<NotEmpty,
Collection> - Parameters:
collection
- the collection to validateconstraintValidatorContext
- context in which the constraint is evaluated- Returns:
- returns
true
if the collection is notnull
and the collection is not empty
-