Class CheckerLocalTime
java.lang.Object
util.AbstractChecker<LocalTime,CheckerLocalTime>
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>
CheckerLocalTime is a specialized checker for validating and performing assertions on
LocalTime
values.
It provides a fluent API for common local time validations such as checking if a time is before, after, in range, past, or future.
-
Field Summary
Fields inherited from class util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CheckerLocalTime
(LocalTime localtime, String name) Constructs a newCheckerLocalTime
with the specified localtime and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLocalTime
Creates a new CheckerLocalTime instance for the given local time with a default name.static CheckerLocalTime
Creates 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 CheckerLocalTime
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
-
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:
self
in classAbstractChecker<LocalTime,
CheckerLocalTime> - Returns:
- this CheckerLocalTime instance
-
isBefore
Checks if the local time is before the specified time.- Specified by:
isBefore
in 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:
isBeforeOrEqual
in 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:
isAfter
in 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:
isAfterOrEqual
in 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:
inRange
in 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:
isPast
in 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:
isFuture
in interfaceInterfaceCheckerDate<CheckerLocalTime,
LocalTime> - Returns:
- this CheckerLocalTime instance for chaining
-