Class CheckerLocalDate
java.lang.Object
util.AbstractChecker<LocalDate,CheckerLocalDate>
specialized_checkers.time.temporal.CheckerLocalDate
- All Implemented Interfaces:
InterfaceCheckerDate<CheckerLocalDate,
,LocalDate> InterfaceChecker<AbstractChecker<LocalDate,
CheckerLocalDate>, LocalDate>
public class CheckerLocalDate
extends AbstractChecker<LocalDate,CheckerLocalDate>
implements InterfaceCheckerDate<CheckerLocalDate,LocalDate>
CheckerLocalDate is a specialized checker for validating and performing assertions on
LocalDate
values.
It provides a fluent API for common local date validations such as checking if a date is before, after, in range, past, future, or present.
-
Field Summary
Fields inherited from class util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CheckerLocalDate
(LocalDate localdate, String name) Constructs a newCheckerLocalDate
with the specified localdate and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLocalDate
Creates a new CheckerLocalDate instance for the given local date with a default name.static CheckerLocalDate
Creates a new CheckerLocalDate instance for the given local date and name.Checks if the local date is within the specified range (exclusive).Checks if the local date is after the specified date.isAfterOrEqual
(LocalDate date) Checks if the local date is after or equal to the specified date.Checks if the local date is before the specified date.isBeforeOrEqual
(LocalDate date) Checks if the local date is before or equal to the specified date.isFuture()
Checks if the local date is in the future (after the current date).Checks if the local date is in the future or present (not before the current date).isPast()
Checks if the local date is in the past (before the current date).Checks if the local date is in the past or present (not after the current date).protected CheckerLocalDate
self()
Returns this instance (for fluent API usage).Methods inherited from class util.AbstractChecker
checkProperty, checkProperty, checkProperty, end, getMethod, getObject, getProperty, hasErrors, hasNotErrors, is, is, isEqual, isNonNull, isNot, isNot, isNull, notSaveErrors, saveErrors, show, showNotThrownException, showThrownException, stop
-
Constructor Details
-
CheckerLocalDate
-
-
Method Details
-
check
Creates a new CheckerLocalDate instance for the given local date and name.- Parameters:
localdate
- the local date value to be checkedname
- the name to identify the local date in error messages- Returns:
- a CheckerLocalDate instance for further validations
-
check
Creates a new CheckerLocalDate instance for the given local date with a default name.- Parameters:
localdate
- the local date value to be checked- Returns:
- a CheckerLocalDate instance for further validations
-
self
Returns this instance (for fluent API usage).- Specified by:
self
in classAbstractChecker<LocalDate,
CheckerLocalDate> - Returns:
- this CheckerLocalDate instance
-
isBefore
Checks if the local date is before the specified date.- Specified by:
isBefore
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Parameters:
date
- the date to compare with- Returns:
- this CheckerLocalDate instance for chaining
-
isBeforeOrEqual
Checks if the local date is before or equal to the specified date.- Specified by:
isBeforeOrEqual
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Parameters:
date
- the date to compare with- Returns:
- this CheckerLocalDate instance for chaining
-
isAfter
Checks if the local date is after the specified date.- Specified by:
isAfter
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Parameters:
date
- the date to compare with- Returns:
- this CheckerLocalDate instance for chaining
-
isAfterOrEqual
Checks if the local date is after or equal to the specified date.- Specified by:
isAfterOrEqual
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Parameters:
date
- the date to compare with- Returns:
- this CheckerLocalDate instance for chaining
-
inRange
Checks if the local date is within the specified range (exclusive).- Specified by:
inRange
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Parameters:
date_1
- the start date (exclusive)date_2
- the end date (exclusive)- Returns:
- this CheckerLocalDate instance for chaining
-
isPast
Checks if the local date is in the past (before the current date).- Specified by:
isPast
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Returns:
- this CheckerLocalDate instance for chaining
-
isFuture
Checks if the local date is in the future (after the current date).- Specified by:
isFuture
in interfaceInterfaceCheckerDate<CheckerLocalDate,
LocalDate> - Returns:
- this CheckerLocalDate instance for chaining
-
isPastOrPresent
Checks if the local date is in the past or present (not after the current date).- Returns:
- this CheckerLocalDate instance for chaining
-
isFutureOrPresent
Checks if the local date is in the future or present (not before the current date).- Returns:
- this CheckerLocalDate instance for chaining
-