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