Class AbstractPastJavaTimeValidator<T extends TemporalAccessor & Comparable<? super T>>
java.lang.Object
org.hibernate.validator.internal.constraintvalidators.bv.time.AbstractJavaTimeValidator<Past,T>
org.hibernate.validator.internal.constraintvalidators.bv.time.past.AbstractPastJavaTimeValidator<T>
- All Implemented Interfaces:
ConstraintValidator<Past,
,T> HibernateConstraintValidator<Past,
T>
- Direct Known Subclasses:
PastValidatorForHijrahDate
,PastValidatorForInstant
,PastValidatorForJapaneseDate
,PastValidatorForLocalDate
,PastValidatorForLocalDateTime
,PastValidatorForLocalTime
,PastValidatorForMinguoDate
,PastValidatorForMonthDay
,PastValidatorForOffsetDateTime
,PastValidatorForOffsetTime
,PastValidatorForThaiBuddhistDate
,PastValidatorForYear
,PastValidatorForYearMonth
,PastValidatorForZonedDateTime
public abstract class AbstractPastJavaTimeValidator<T extends TemporalAccessor & Comparable<? super T>>
extends AbstractJavaTimeValidator<Past,T>
Base class for all
@Past
validators that are based on the java.time
package.- Author:
- Alaa Nassef, Guillaume Smet
-
Field Summary
Fields inherited from class org.hibernate.validator.internal.constraintvalidators.bv.time.AbstractJavaTimeValidator
referenceClock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Duration
getEffectiveTemporalValidationTolerance
(Duration absoluteTemporalValidationTolerance) Returns the temporal validation tolerance to apply.protected boolean
isValid
(int result) Returns whether the result of the comparison between the validated value and the time reference is considered valid.Methods inherited from class org.hibernate.validator.internal.constraintvalidators.bv.time.AbstractJavaTimeValidator
getReferenceValue, initialize, isValid
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jakarta.validation.ConstraintValidator
initialize
-
Constructor Details
-
AbstractPastJavaTimeValidator
public AbstractPastJavaTimeValidator()
-
-
Method Details
-
isValid
protected boolean isValid(int result) Description copied from class:AbstractJavaTimeValidator
Returns whether the result of the comparison between the validated value and the time reference is considered valid.- Specified by:
isValid
in classAbstractJavaTimeValidator<Past,
T extends TemporalAccessor & Comparable<? super T>>
-
getEffectiveTemporalValidationTolerance
protected Duration getEffectiveTemporalValidationTolerance(Duration absoluteTemporalValidationTolerance) Description copied from class:AbstractJavaTimeValidator
Returns the temporal validation tolerance to apply.- Specified by:
getEffectiveTemporalValidationTolerance
in classAbstractJavaTimeValidator<Past,
T extends TemporalAccessor & Comparable<? super T>>
-