public class SizeValidatorForMap extends SizeValidator implements javax.validation.ConstraintValidator<javax.validation.constraints.Size,Map<?,?>>
max, min| Constructor and Description |
|---|
SizeValidatorForMap() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isValid(Map<?,?> map,
javax.validation.ConstraintValidatorContext context)
Checks the number of entries in a map.
|
initializepublic boolean isValid(Map<?,?> map, javax.validation.ConstraintValidatorContext context)
isValid in interface javax.validation.ConstraintValidator<javax.validation.constraints.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–2022 The Apache Software Foundation. All rights reserved.