public class OptionalStringValidator extends Object implements javax.validation.ConstraintValidator<OptionalString,String>
OptionalString
annotation.Constructor and Description |
---|
OptionalStringValidator() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(OptionalString constraintAnnotation) |
boolean |
isValid(String s,
javax.validation.ConstraintValidatorContext constraintValidatorContext)
Checks that the trimmed string is not empty.
|
public void initialize(OptionalString constraintAnnotation)
initialize
in interface javax.validation.ConstraintValidator<OptionalString,String>
public boolean isValid(String s, javax.validation.ConstraintValidatorContext constraintValidatorContext)
isValid
in interface javax.validation.ConstraintValidator<OptionalString,String>
s
- The string to validate.constraintValidatorContext
- 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 © 2022 Atlassian. All rights reserved.