public class UniqueElementsValidator extends Object implements ConstraintValidator<UniqueElements,Collection>
Uniqueness is defined by the equals() method of the objects being compared.
| Constructor and Description |
|---|
UniqueElementsValidator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isValid(Collection collection,
ConstraintValidatorContext constraintValidatorContext)
Implements the validation logic.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializepublic boolean isValid(Collection collection, ConstraintValidatorContext constraintValidatorContext)
ConstraintValidatorvalue must not be altered.
This method can be accessed concurrently, thread-safety must be ensured by the implementation.
isValid in interface ConstraintValidator<UniqueElements,Collection>collection - the collection to validateconstraintValidatorContext - context in which the constraint is evaluatedCopyright © 2019 JBoss by Red Hat. All rights reserved.