Class LocalDateTimeFunction
- java.lang.Object
-
- org.exparity.hamcrest.date.core.function.LocalDateTimeFunction
-
- All Implemented Interfaces:
TemporalFunction<LocalDateTime>
public class LocalDateTimeFunction extends Object implements TemporalFunction<LocalDateTime>
Implementation ofTemporalFunctionforLocalDateTimeobjects.- Author:
- Stewart Bissett
-
-
Constructor Summary
Constructors Constructor Description LocalDateTimeFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescribe(LocalDateTime temporal, Locale locale)Describe a temporal typeIntervalinterval(LocalDateTime expected, LocalDateTime other, ChronoUnit unit)Return the interval between two temporalsbooleanisAfter(LocalDateTime expected, LocalDateTime actual)Test if a temporal is after another temporalbooleanisBefore(LocalDateTime expected, LocalDateTime actual)Test if a temporal is before another temporalbooleanisSame(LocalDateTime expected, LocalDateTime actual)Test if a temporal is the same as another temporal
-
-
-
Method Detail
-
isAfter
public boolean isAfter(LocalDateTime expected, LocalDateTime actual)
Description copied from interface:TemporalFunctionTest if a temporal is after another temporal- Specified by:
isAfterin interfaceTemporalFunction<LocalDateTime>- Parameters:
expected- the temporal to test foractual- the temporal to test against- Returns:
- a boolean
-
isBefore
public boolean isBefore(LocalDateTime expected, LocalDateTime actual)
Description copied from interface:TemporalFunctionTest if a temporal is before another temporal- Specified by:
isBeforein interfaceTemporalFunction<LocalDateTime>- Parameters:
expected- the temporal to test foractual- the temporal to test against- Returns:
- a boolean
-
isSame
public boolean isSame(LocalDateTime expected, LocalDateTime actual)
Description copied from interface:TemporalFunctionTest if a temporal is the same as another temporal- Specified by:
isSamein interfaceTemporalFunction<LocalDateTime>- Parameters:
expected- the temporal to test foractual- the temporal to test against- Returns:
- a boolean
-
interval
public Interval interval(LocalDateTime expected, LocalDateTime other, ChronoUnit unit)
Description copied from interface:TemporalFunctionReturn the interval between two temporals- Specified by:
intervalin interfaceTemporalFunction<LocalDateTime>- Parameters:
expected- the temporal to test forother- the temporal to test againstunit- the unit to measure the interval in- Returns:
- an
Interval
-
describe
public String describe(LocalDateTime temporal, Locale locale)
Description copied from interface:TemporalFunctionDescribe a temporal type- Specified by:
describein interfaceTemporalFunction<LocalDateTime>- Parameters:
temporal- the temporal instance to describelocale- the locale to describe the temporal in- Returns:
- a string description of the temporal
-
-