Class TemporalMatcher
java.lang.Object
org.hamcrest.BaseMatcher<Temporal>
io.github.cjstehno.testthings.match.TemporalMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<Temporal>
,org.hamcrest.SelfDescribing
Matchers used to match temporal-based criteria.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) static org.hamcrest.Matcher<Temporal>
fieldIsEqualTo
(TemporalField field, int value) Matches a temporal field that is equal to the specified value.static org.hamcrest.Matcher<Temporal>
fieldIsGreaterThan
(TemporalField field, int value) Matches a temporal field that is greater than the specified value.static org.hamcrest.Matcher<Temporal>
fieldIsGreaterThanOrEqualTo
(TemporalField field, int value) Matches a temporal field that is greater than or equal to the specified value.static org.hamcrest.Matcher<Temporal>
fieldIsLessThan
(TemporalField field, int value) Matches a temporal field that is less than the specified value.static org.hamcrest.Matcher<Temporal>
fieldIsLessThanOrEqualTo
(TemporalField field, int value) Matches a temporal field that is less than or equal to the specified value.static org.hamcrest.Matcher<Temporal>
isDayOfWeek
(int dow) Matches a DAY_OF_WEEK value with the specified value.static org.hamcrest.Matcher<Temporal>
isDayOfWeek
(DayOfWeek dow) Matches a DAY_OF_WEEK value with the specified value.static org.hamcrest.Matcher<Temporal>
Matches an HOUR_OF_DAY value of noon or later, but before midnight.static org.hamcrest.Matcher<Temporal>
isInHourOfDay
(int hour) Matches a HOUR_OF_DAY value with the specified value.static org.hamcrest.Matcher<Temporal>
isInMonth
(int month) Matches a MONTH_OF_YEAR value with the specified value.static org.hamcrest.Matcher<Temporal>
Matches a MONTH_OF_YEAR value with the specified value.static org.hamcrest.Matcher<Temporal>
Matches an HOUR_OF_DAY value after midnight and before noon.static org.hamcrest.Matcher<Temporal>
isInYear
(int year) Matches a YEAR value with the specified value.static org.hamcrest.Matcher<Temporal>
Matches a DAY_OF_WEEK value for a weekday (i.e.static org.hamcrest.Matcher<Temporal>
Matches a DAY_OF_WEEK value for a weekend (i.e.boolean
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Constructor Details
-
TemporalMatcher
public TemporalMatcher()
-
-
Method Details
-
fieldIsEqualTo
Matches a temporal field that is equal to the specified value.- Parameters:
field
- the temporal fieldvalue
- the target value- Returns:
- the matcher
-
fieldIsGreaterThan
Matches a temporal field that is greater than the specified value.- Parameters:
field
- the temporal fieldvalue
- the target value- Returns:
- the matcher
-
fieldIsGreaterThanOrEqualTo
public static org.hamcrest.Matcher<Temporal> fieldIsGreaterThanOrEqualTo(TemporalField field, int value) Matches a temporal field that is greater than or equal to the specified value.- Parameters:
field
- the temporal fieldvalue
- the target value- Returns:
- the matcher
-
fieldIsLessThan
Matches a temporal field that is less than the specified value.- Parameters:
field
- the temporal fieldvalue
- the target value- Returns:
- the matcher
-
fieldIsLessThanOrEqualTo
public static org.hamcrest.Matcher<Temporal> fieldIsLessThanOrEqualTo(TemporalField field, int value) Matches a temporal field that is less than or equal to the specified value.- Parameters:
field
- the temporal fieldvalue
- the target value- Returns:
- the matcher
-
isInYear
Matches a YEAR value with the specified value.- Parameters:
year
- the year- Returns:
- the matcher
-
isInMonth
Matches a MONTH_OF_YEAR value with the specified value.- Parameters:
month
- the month of the year- Returns:
- the matcher
-
isInMonth
Matches a MONTH_OF_YEAR value with the specified value.- Parameters:
month
- the month of the year- Returns:
- the matcher
-
isInHourOfDay
Matches a HOUR_OF_DAY value with the specified value.- Parameters:
hour
- the hour of the day- Returns:
- the matcher
-
isInMorning
Matches an HOUR_OF_DAY value after midnight and before noon.- Returns:
- the matcher
-
isInAfternoon
Matches an HOUR_OF_DAY value of noon or later, but before midnight.- Returns:
- the matcher
-
isDayOfWeek
Matches a DAY_OF_WEEK value with the specified value.- Parameters:
dow
- day of the week- Returns:
- the matcher
-
isDayOfWeek
Matches a DAY_OF_WEEK value with the specified value.- Parameters:
dow
- day of the week- Returns:
- the matcher
-
isWeekday
Matches a DAY_OF_WEEK value for a weekday (i.e. MONDAY through FRIDAY inclusive).- Returns:
- the matcher
-
isWeekend
Matches a DAY_OF_WEEK value for a weekend (i.e. SATURDAY or SUNDAY).- Returns:
- the matcher
-
matches
-
describeTo
public void describeTo(org.hamcrest.Description description)
-