A
- The constraint annotation type.T
- The TemporalAccessor
type to validate.P
- The TemporalAccessor
type that describes the part to validate.public abstract static class PartValidator.WithoutZoneId<A extends Annotation,T extends TemporalAccessor,P extends TemporalAccessor> extends PartValidator<A,T,P>
TemporalAccessor
validators that validate only a specific part of the value.
This sub type of PartValidator
can be used for types that don't use zones like LocalDate
.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 |
WithoutZoneId(Function<A,String> zoneIdExtractor,
Function<T,P> partExtractor,
Function<A,BiPredicate<P,ClockProvider>> partPredicateExtractor)
Creates a new validator.
|
initialize, isValid, minus, not, plus, useReplacementMessageTemplate
protected WithoutZoneId(Function<A,String> zoneIdExtractor, Function<T,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.systemOnlyZoneId(Function)
.partExtractor
- A function that extracts a part from a TemporalAccessor
.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.