public abstract class AbstractDateValidator extends Object
AttributeValidator
s that validate Date
s.Constructor and Description |
---|
AbstractDateValidator() |
Modifier and Type | Method and Description |
---|---|
protected Optional<AttributeValidationReport> |
validate(Attribute attribute,
Function<Date,Boolean> validator,
String message)
Validates the values of
attribute that are Date s. |
protected final Optional<AttributeValidationReport> validate(Attribute attribute, Function<Date,Boolean> validator, String message)
attribute
that are Date
s.
If validator
returns false for a value, this method will return an Optional
containing an AttributeValidationReport
with a message of attribute.getName() +
" " + message
and a severity of ValidationViolation.Severity.ERROR
. Otherwise, an empty Optional
is returned.
attribute
- the Attribute
to validatevalidator
- the test to apply to the values of attribute
message
- the message to include in the report in the case of a validation violationOptional
containing an AttributeValidationReport
if there are
violations, or an empty Optional
if there are no violationsThis work is licensed under a Creative Commons Attribution 4.0 International License.