Class CheckerLocalDateTime
java.lang.Object
com.luchersol.core.util.AbstractChecker<LocalDateTime,CheckerLocalDateTime>
com.luchersol.core.specialized_checkers.time.temporal.CheckerLocalDateTime
- All Implemented Interfaces:
InterfaceCheckerDate<CheckerLocalDateTime,,LocalDateTime> InterfaceChecker<AbstractChecker<LocalDateTime,CheckerLocalDateTime>, LocalDateTime>
public class CheckerLocalDateTime
extends AbstractChecker<LocalDateTime,CheckerLocalDateTime>
implements InterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime>
A specialized checker for
LocalDateTime instances, providing fluent API methods
to assert temporal properties such as being before/after another date-time, inclusivity checks,
range validations, and whether a date-time lies in the past or future relative to the system clock.
Typical usage:
LocalDateTime now = LocalDateTime.now();
LocalDateTime tomorrow = now.plusDays(1);
CheckerLocalDateTime checker = CheckerLocalDateTime.check(now)
.isBefore(tomorrow)
.isAfterOrEqual(now)
.isPast();
This class integrates with InterfaceCheckerDate for standardized temporal
validations and supports chaining multiple assertions in a fluent, expressive style.
- See Also:
-
Field Summary
Fields inherited from class com.luchersol.core.util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCheckerLocalDateTime(LocalDateTime localdatetime, String name) Constructs a newCheckerLocalDateTimewith the specified localdatetime and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLocalDateTimecheck(LocalDateTime localdatetime) Creates a new CheckerLocalDateTime instance for the given local date-time with a default name.static CheckerLocalDateTimecheck(LocalDateTime localdatetime, String name) Creates a new CheckerLocalDateTime instance for the given local date-time and name.inRange(LocalDateTime date_1, LocalDateTime date_2) Checks if the local date-time is within the specified range (exclusive).isAfter(LocalDateTime date) Checks if the local date-time is after the specified date-time.isAfterOrEqual(LocalDateTime date) Checks if the local date-time is after or equal to the specified date-time.isBefore(LocalDateTime date) Checks if the local date-time is before the specified date-time.isBeforeOrEqual(LocalDateTime date) Checks if the local date-time is before or equal to the specified date-time.isFuture()Checks if the local date-time is in the future (after the current date-time).isPast()Checks if the local date-time is in the past (before the current date-time).protected CheckerLocalDateTimeself()Returns this instance (for fluent API usage).Methods inherited from class com.luchersol.core.util.AbstractChecker
checkProperty, checkProperty, checkProperty, checkProperty, end, getMethod, getObject, getProperty, hasErrors, hasNotErrors, is, is, is, isEqual, isNonNull, isNot, isNot, isNull, notSaveErrors, saveErrors, setBackObject, setExceptionTracker, setName, setObject, setSaveErrors, setStop, show, showPassedChecks, showThrownException, stop, toChecker, updateChecker
-
Constructor Details
-
CheckerLocalDateTime
Constructs a newCheckerLocalDateTimewith the specified localdatetime and name.- Parameters:
localdatetime- theLocalDateTimeto be wrapped and checkedname- the name identifying this checker function
-
-
Method Details
-
check
Creates a new CheckerLocalDateTime instance for the given local date-time and name.- Parameters:
localdatetime- the local date-time value to be checkedname- the name to identify the local date-time in error messages- Returns:
- a CheckerLocalDateTime instance for further validations
-
check
Creates a new CheckerLocalDateTime instance for the given local date-time with a default name.- Parameters:
localdatetime- the local date-time value to be checked- Returns:
- a CheckerLocalDateTime instance for further validations
-
self
Returns this instance (for fluent API usage).- Specified by:
selfin classAbstractChecker<LocalDateTime,CheckerLocalDateTime> - Returns:
- this CheckerLocalDateTime instance
-
isBefore
Checks if the local date-time is before the specified date-time.- Specified by:
isBeforein interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Parameters:
date- the date-time to compare with- Returns:
- this CheckerLocalDateTime instance for chaining
-
isBeforeOrEqual
Checks if the local date-time is before or equal to the specified date-time.- Specified by:
isBeforeOrEqualin interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Parameters:
date- the date-time to compare with- Returns:
- this CheckerLocalDateTime instance for chaining
-
isAfter
Checks if the local date-time is after the specified date-time.- Specified by:
isAfterin interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Parameters:
date- the date-time to compare with- Returns:
- this CheckerLocalDateTime instance for chaining
-
isAfterOrEqual
Checks if the local date-time is after or equal to the specified date-time.- Specified by:
isAfterOrEqualin interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Parameters:
date- the date-time to compare with- Returns:
- this CheckerLocalDateTime instance for chaining
-
inRange
Checks if the local date-time is within the specified range (exclusive).- Specified by:
inRangein interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Parameters:
date_1- the start date-time (exclusive)date_2- the end date-time (exclusive)- Returns:
- this CheckerLocalDateTime instance for chaining
-
isPast
Checks if the local date-time is in the past (before the current date-time).- Specified by:
isPastin interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Returns:
- this CheckerLocalDateTime instance for chaining
-
isFuture
Checks if the local date-time is in the future (after the current date-time).- Specified by:
isFuturein interfaceInterfaceCheckerDate<CheckerLocalDateTime,LocalDateTime> - Returns:
- this CheckerLocalDateTime instance for chaining
-