Class CheckerLocalDateTime
java.lang.Object
util.AbstractChecker<LocalDateTime,CheckerLocalDateTime>
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>
CheckerLocalDateTime is a specialized checker for validating and performing assertions on
LocalDateTime
values.
It provides a fluent API for common local date-time validations such as checking if a date-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
CheckerLocalDateTime
(LocalDateTime localdatetime, String name) Constructs a newCheckerLocalDateTime
with the specified localdatetime and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLocalDateTime
check
(LocalDateTime localdatetime) Creates a new CheckerLocalDateTime instance for the given local date-time with a default name.static CheckerLocalDateTime
check
(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 CheckerLocalDateTime
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
-
CheckerLocalDateTime
Constructs a newCheckerLocalDateTime
with the specified localdatetime and name.- Parameters:
localdatetime
- theLocalDateTime
to 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:
self
in classAbstractChecker<LocalDateTime,
CheckerLocalDateTime> - Returns:
- this CheckerLocalDateTime instance
-
isBefore
Checks if the local date-time is before the specified date-time.- Specified by:
isBefore
in 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:
isBeforeOrEqual
in 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:
isAfter
in 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:
isAfterOrEqual
in 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:
inRange
in 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:
isPast
in 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:
isFuture
in interfaceInterfaceCheckerDate<CheckerLocalDateTime,
LocalDateTime> - Returns:
- this CheckerLocalDateTime instance for chaining
-