public class SizeValidatorForCharSequence extends Object implements ConstraintValidator<Size,CharSequence>
Constructor and Description |
---|
SizeValidatorForCharSequence() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Size parameters) |
boolean |
isValid(CharSequence charSequence,
ConstraintValidatorContext constraintValidatorContext)
Checks the length of the specified character sequence (e.g.
|
public void initialize(Size parameters)
initialize
in interface ConstraintValidator<Size,CharSequence>
public boolean isValid(CharSequence charSequence, ConstraintValidatorContext constraintValidatorContext)
isValid
in interface ConstraintValidator<Size,CharSequence>
charSequence
- The character sequence to validate.constraintValidatorContext
- context in which the constraint is evaluated.true
if the string is null
or the length of charSequence
between the specified
min
and max
values (inclusive), false
otherwise.Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved