Top Description Constructors Methods
org.hibernate.validator.internal.constraintvalidators.bv.notempty

public Class NotEmptyValidatorForCollection

extends Object
implements ConstraintValidator<NotEmpty, Collection<E>>
Class Inheritance
All Implemented Interfaces
jakarta.validation.ConstraintValidator
Annotations
@SuppressWarnings:rawtypes
Imports
java.util.Collection, jakarta.validation.ConstraintValidator, .ConstraintValidatorContext, jakarta.validation.constraints.NotEmpty

Check that the collection is not null and not empty.
Author
Guillaume Smet

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

returns true if the collection is not null and the collection is not empty
isValid
(Collection<E>
the collection to validate
collection
,
ConstraintValidatorContext
context in which the constraint is evaluated
constraintValidatorContext
)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks the collection is not null and not empty.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NotEmptyValidatorForCollectionback to summary
public NotEmptyValidatorForCollection()

Method Detail

isValidback to summary
public boolean isValid(Collection<E> collection, ConstraintValidatorContext constraintValidatorContext)

Implements jakarta.validation.ConstraintValidator.isValid.

Checks the collection is not null and not empty.

Parameters
collection:Collection<E>

the collection to validate

constraintValidatorContext:ConstraintValidatorContext

context in which the constraint is evaluated

Returns:boolean

returns true if the collection is not null and the collection is not empty

Annotations
@Override