org.apache.bval.constraints
Class SizeValidatorForMap
java.lang.Object
org.apache.bval.constraints.SizeValidator
org.apache.bval.constraints.SizeValidatorForMap
- All Implemented Interfaces:
- ConstraintValidator<Size,Map<?,?>>
public class SizeValidatorForMap
- extends SizeValidator
- implements ConstraintValidator<Size,Map<?,?>>
Check that a Map's size is between min and max.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizeValidatorForMap
public SizeValidatorForMap()
isValid
public boolean isValid(Map<?,?> map,
ConstraintValidatorContext context)
- Checks the number of entries in a map.
- Specified by:
isValid in interface ConstraintValidator<Size,Map<?,?>>
- Parameters:
map - The map to validate.context - context in which the constraint is evaluated.
- Returns:
- Returns
true if the map is null or the number of entries in map
is between the specified min and max values (inclusive),
false otherwise.
Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.