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