public class SizeValidatorForMap extends Object implements ConstraintValidator<Size,Map<?,?>>
Constructor and Description |
---|
SizeValidatorForMap() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Size parameters)
Initialize the validator in preparation for isValid calls.
|
boolean |
isValid(Map<?,?> map,
ConstraintValidatorContext constraintValidatorContext)
Checks the number of entries in a map.
|
public void initialize(Size parameters)
ConstraintValidator
initialize
in interface ConstraintValidator<Size,Map<?,?>>
parameters
- annotation instance for a given constraint declarationpublic boolean isValid(Map<?,?> map, ConstraintValidatorContext constraintValidatorContext)
isValid
in interface ConstraintValidator<Size,Map<?,?>>
map
- The map to validate.constraintValidatorContext
- 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 © 2018 JBoss by Red Hat. All rights reserved.