public class SizeValidatorForCollection extends Object implements ConstraintValidator<Size,Collection<?>>
| Constructor and Description |
|---|
SizeValidatorForCollection() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(Size parameters) |
boolean |
isValid(Collection<?> collection,
ConstraintValidatorContext constraintValidatorContext)
Checks the number of entries in a map.
|
public void initialize(Size parameters)
initialize in interface ConstraintValidator<Size,Collection<?>>public boolean isValid(Collection<?> collection, ConstraintValidatorContext constraintValidatorContext)
isValid in interface ConstraintValidator<Size,Collection<?>>collection - The collection to validate.constraintValidatorContext - 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 © 2007-2012 Red Hat Middleware, LLC. All Rights Reserved