public class SizeValidatorForCollection extends SizeValidator implements ConstraintValidator<Size,Collection<?>>
max, min
Constructor and Description |
---|
SizeValidatorForCollection() |
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(Collection<?> collection,
ConstraintValidatorContext context)
Checks the number of entries in a map.
|
initialize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
public boolean isValid(Collection<?> collection, ConstraintValidatorContext context)
isValid
in interface ConstraintValidator<Size,Collection<?>>
collection
- The collection to validate.context
- context in which the constraint is evaluated.true
if the collection is null
or the number of entries in
collection
is between the specified min
and max
values (inclusive),
false
otherwise.Copyright © 2010–2024 The Apache Software Foundation. All rights reserved.