A
- The constraint annotation type.T
- The TemporalAccessor
type to validate.public abstract class MomentValueValidator<A extends Annotation,T extends TemporalAccessor> extends ValueValidator<A,T>
TemporalAccessor
validators that validate the entire value against a specific moment in time.Modifier and Type | Field and Description |
---|---|
static String |
NOW
A string representing the current date/time.
|
Modifier | Constructor and Description |
---|---|
protected |
MomentValueValidator(Function<A,String> momentExtractor,
Function<String,T> momentParser,
Function<Clock,T> momentCreator,
BiPredicate<T,T> validPredicate)
Creates a new validator that only validates
TemporalAccessor s against a specific moment in time. |
protected |
MomentValueValidator(Function<A,String> momentExtractor,
Function<String,T> momentParser,
Function<Clock,T> momentCreator,
Function<A,String> durationExtractor,
BiFunction<T,TemporalAmount,T> durationApplier,
BiPredicate<T,T> validPredicate)
Creates a new validator that only validates
TemporalAccessor s against a specific duration before or after a specific moment in time. |
initialize, isValid, minus, not, plus, useReplacementMessageTemplate
public static final String NOW
protected MomentValueValidator(Function<A,String> momentExtractor, Function<String,T> momentParser, Function<Clock,T> momentCreator, BiPredicate<T,T> validPredicate)
TemporalAccessor
s against a specific moment in time.momentExtractor
- A function that extracts the moment value from a constraint annotation.momentParser
- A function that parses a moment value into a TemporalAccessor
.momentCreator
- A function that creates a new moment for a given clock.validPredicate
- A predicate that determines whether or not a value (the first argument) is valid compared to a specific moment
(the second argument).protected MomentValueValidator(Function<A,String> momentExtractor, Function<String,T> momentParser, Function<Clock,T> momentCreator, Function<A,String> durationExtractor, BiFunction<T,TemporalAmount,T> durationApplier, BiPredicate<T,T> validPredicate)
TemporalAccessor
s against a specific duration before or after a specific moment in time.momentExtractor
- A function that extracts the moment value from a constraint annotation.momentParser
- A function that parses a moment value into a TemporalAccessor
.momentCreator
- A function that creates a new moment for a given clock.durationExtractor
- A function that extracts the duration value from a constraint annotation.durationApplier
- A function that applies a duration to a TemporalAccessor
.validPredicate
- A predicate that determines whether or not a value (the first argument) is valid compared to a specific moment
(the second argument).Copyright © 2021–2022. All rights reserved.