public class SizeValidatorForMap extends SizeValidator implements ConstraintValidator<Size,Map<?,?>>
max, min| Constructor and Description |
|---|
SizeValidatorForMap() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isValid(Map<?,?> map,
ConstraintValidatorContext context)
Checks the number of entries in a map.
|
initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializepublic boolean isValid(Map<?,?> map, ConstraintValidatorContext context)
isValid in interface ConstraintValidator<Size,Map<?,?>>map - The map to validate.context - context in which the constraint is evaluated.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–2024 The Apache Software Foundation. All rights reserved.