Package org.exparity.hamcrest.date.core
Interface TemporalFunction<T>
-
- Type Parameters:
T- the temporal type
- All Known Implementing Classes:
DateFunction,InstantFunction,LocalDateFunction,LocalDateTimeFunction,LocalTimeFunction,OffsetDateTimeFunction,SqlDateFunction,ZonedDateTimeFunction
public interface TemporalFunction<T>Suite of temporal functions for a temporal type- Author:
- Stewart Bissett
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringdescribe(T temporal, Locale locale)Describe a temporal typeIntervalinterval(T temporal, T other, ChronoUnit unit)Return the interval between two temporalsbooleanisAfter(T temporal, T other)Test if a temporal is after another temporalbooleanisBefore(T temporal, T other)Test if a temporal is before another temporalbooleanisSame(T temporal, T other)Test if a temporal is the same as another temporal
-
-
-
Method Detail
-
describe
String describe(T temporal, Locale locale)
Describe a temporal type- Parameters:
temporal- the temporal instance to describelocale- the locale to describe the temporal in- Returns:
- a string description of the temporal
-
isSame
boolean isSame(T temporal, T other)
Test if a temporal is the same as another temporal- Parameters:
temporal- the temporal to test forother- the temporal to test against- Returns:
- a boolean
-
isAfter
boolean isAfter(T temporal, T other)
Test if a temporal is after another temporal- Parameters:
temporal- the temporal to test forother- the temporal to test against- Returns:
- a boolean
-
isBefore
boolean isBefore(T temporal, T other)
Test if a temporal is before another temporal- Parameters:
temporal- the temporal to test forother- the temporal to test against- Returns:
- a boolean
-
interval
Interval interval(T temporal, T other, ChronoUnit unit)
Return the interval between two temporals- Parameters:
temporal- the temporal to test forother- the temporal to test againstunit- the unit to measure the interval in- Returns:
- an
Interval
-
-