public class SizeValidatorForCharSequence extends SizeValidator implements ConstraintValidator<Size,CharSequence>
max, min| Constructor and Description |
|---|
SizeValidatorForCharSequence() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isValid(CharSequence s,
ConstraintValidatorContext context)
Checks the length of the specified string.
|
initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializepublic boolean isValid(CharSequence s, ConstraintValidatorContext context)
isValid in interface ConstraintValidator<Size,CharSequence>s - The string to validate.context - context in which the constraint is evaluated.true if the string is null or the length of s between the specified
min and max values (inclusive), false otherwise.Copyright © 2010–2024 The Apache Software Foundation. All rights reserved.