A
- The constraint annotation type.public abstract static class FieldValidator.ForInstant<A extends Annotation> extends FieldValidator<A,Instant>
Instant
validators that validate only a specific field of the value.FieldValidator.ForInstant<A extends Annotation>, FieldValidator.ForOffsetTime<A extends Annotation>, FieldValidator.ForZonedDateTime<A extends Annotation>, FieldValidator.WithoutZoneId<A extends Annotation,T extends TemporalAccessor>
Modifier | Constructor and Description |
---|---|
protected |
ForInstant(Function<A,TemporalField> fieldExtractor,
Function<A,String> zoneIdExtractor,
Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
Creates a new validator.
|
protected |
ForInstant(TemporalField field,
Function<A,String> zoneIdExtractor,
Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
Creates a new validator.
|
initialize, isValid, minus, not, plus, useReplacementMessageTemplate
protected ForInstant(Function<A,TemporalField> fieldExtractor, Function<A,String> zoneIdExtractor, Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
fieldExtractor
- A function that extracts the field to validate from a constraint annotation.zoneIdExtractor
- A function that extracts the zone id from a constraint annotation.
It will be wrapped using ZoneIdUtils.nonProvidedZoneId(Function)
.fieldPredicateExtractor
- A function that extracts a field predicate from a constraint annotation.
This predicate will be called in BaseValidator.isValid(Object, ConstraintValidatorContext)
,
with as arguments the field extracted from the value to validate and the ClockProvider
returned
by ConstraintValidatorContext.getClockProvider()
.protected ForInstant(TemporalField field, Function<A,String> zoneIdExtractor, Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
field
- The field to validate.zoneIdExtractor
- A function that extracts the zone id from a constraint annotation.
It will be wrapped using ZoneIdUtils.nonProvidedZoneId(Function)
.fieldPredicateExtractor
- A function that extracts a field predicate from a constraint annotation.
This predicate will be called in BaseValidator.isValid(Object, ConstraintValidatorContext)
,
with as arguments the field extracted from the value to validate and the ClockProvider
returned
by ConstraintValidatorContext.getClockProvider()
.Copyright © 2021–2022. All rights reserved.