Class CheckerLocalTime
java.lang.Object
com.luchersol.core.util.AbstractChecker<LocalTime,CheckerLocalTime>
com.luchersol.core.specialized_checkers.time.temporal.CheckerLocalTime
- All Implemented Interfaces:
InterfaceCheckerDate<CheckerLocalTime,,LocalTime> InterfaceChecker<AbstractChecker<LocalTime,CheckerLocalTime>, LocalTime>
public class CheckerLocalTime
extends AbstractChecker<LocalTime,CheckerLocalTime>
implements InterfaceCheckerDate<CheckerLocalTime,LocalTime>
A specialized checker for
LocalTime instances, providing fluent API methods
to assert temporal properties such as being before/after another time, inclusivity checks,
range validations, and whether a time lies in the past or future relative to the system clock.
Typical usage:
LocalTime now = LocalTime.now();
LocalTime noon = LocalTime.NOON;
CheckerLocalTime checker = CheckerLocalTime.check(now)
.isBefore(noon)
.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
ConstructorsModifierConstructorDescriptionprotectedCheckerLocalTime(LocalTime localtime, String name) Constructs a newCheckerLocalTimewith the specified localtime and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLocalTimeCreates a new CheckerLocalTime instance for the given local time with a default name.static CheckerLocalTimeCreates a new CheckerLocalTime instance for the given local time and name.Checks if the local time is within the specified range (exclusive).Checks if the local time is after the specified time.isAfterOrEqual(LocalTime date) Checks if the local time is after or equal to the specified time.Checks if the local time is before the specified time.isBeforeOrEqual(LocalTime date) Checks if the local time is before or equal to the specified time.isFuture()Checks if the local time is in the future (after the current time).isPast()Checks if the local time is in the past (before the current time).protected CheckerLocalTimeself()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
-
CheckerLocalTime
-
-
Method Details
-
check
Creates a new CheckerLocalTime instance for the given local time and name.- Parameters:
localtime- the local time value to be checkedname- the name to identify the local time in error messages- Returns:
- a CheckerLocalTime instance for further validations
-
check
Creates a new CheckerLocalTime instance for the given local time with a default name.- Parameters:
localtime- the local time value to be checked- Returns:
- a CheckerLocalTime instance for further validations
-
self
Returns this instance (for fluent API usage).- Specified by:
selfin classAbstractChecker<LocalTime,CheckerLocalTime> - Returns:
- this CheckerLocalTime instance
-
isBefore
Checks if the local time is before the specified time.- Specified by:
isBeforein interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Parameters:
date- the time to compare with- Returns:
- this CheckerLocalTime instance for chaining
-
isBeforeOrEqual
Checks if the local time is before or equal to the specified time.- Specified by:
isBeforeOrEqualin interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Parameters:
date- the time to compare with- Returns:
- this CheckerLocalTime instance for chaining
-
isAfter
Checks if the local time is after the specified time.- Specified by:
isAfterin interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Parameters:
date- the time to compare with- Returns:
- this CheckerLocalTime instance for chaining
-
isAfterOrEqual
Checks if the local time is after or equal to the specified time.- Specified by:
isAfterOrEqualin interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Parameters:
date- the time to compare with- Returns:
- this CheckerLocalTime instance for chaining
-
inRange
Checks if the local time is within the specified range (exclusive).- Specified by:
inRangein interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Parameters:
date_1- the start time (exclusive)date_2- the end time (exclusive)- Returns:
- this CheckerLocalTime instance for chaining
-
isPast
Checks if the local time is in the past (before the current time).- Specified by:
isPastin interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Returns:
- this CheckerLocalTime instance for chaining
-
isFuture
Checks if the local time is in the future (after the current time).- Specified by:
isFuturein interfaceInterfaceCheckerDate<CheckerLocalTime,LocalTime> - Returns:
- this CheckerLocalTime instance for chaining
-