A
- The constraint annotation type.public abstract static class FieldValidator.ForOffsetTime<A extends Annotation> extends FieldValidator<A,OffsetTime>
OffsetTime
validators that validate only a specific field of the value.
To apply a ZoneId
to an OffsetTime
, the following mappings are performed:
OffsetTime
to OffsetDateTime
, using LocalDate.now()
.OffsetDateTime
to ZonedDateTime
, using the provided ZoneId
.ZonedDateTime
to OffsetDateTime
.OffsetDateTime
to OffsetTime
.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 |
ForOffsetTime(Function<A,TemporalField> fieldExtractor,
Function<A,String> zoneIdExtractor,
Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
Creates a new validator.
|
protected |
ForOffsetTime(TemporalField field,
Function<A,String> zoneIdExtractor,
Function<A,BiPredicate<Integer,ClockProvider>> fieldPredicateExtractor)
Creates a new validator.
|
initialize, isValid, minus, not, plus, useReplacementMessageTemplate
protected ForOffsetTime(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 ForOffsetTime(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.