public class FutureValidatorForDate extends Object implements ConstraintValidator<Future,Date>
java.util.Date
passed to be validated is in the
future.Constructor and Description |
---|
FutureValidatorForDate() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Future constraintAnnotation)
Initialize the validator in preparation for isValid calls.
|
boolean |
isValid(Date date,
ConstraintValidatorContext constraintValidatorContext)
Implement the validation logic.
|
public void initialize(Future constraintAnnotation)
ConstraintValidator
initialize
in interface ConstraintValidator<Future,Date>
constraintAnnotation
- annotation instance for a given constraint declarationpublic boolean isValid(Date date, ConstraintValidatorContext constraintValidatorContext)
ConstraintValidator
value
must not be altered.
This method can be accessed concurrently, thread-safety must be ensured
by the implementation.isValid
in interface ConstraintValidator<Future,Date>
date
- object to validateconstraintValidatorContext
- context in which the constraint is evaluatedvalue
does not pass the constraintCopyright © 2018 JBoss by Red Hat. All rights reserved.