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

public class TemporalMatcher extends org.hamcrest.BaseMatcher<Temporal>
Matchers used to match temporal-based criteria.
  • Constructor Details

    • TemporalMatcher

      public TemporalMatcher()
  • Method Details

    • fieldIsEqualTo

      public static org.hamcrest.Matcher<Temporal> fieldIsEqualTo(TemporalField field, int value)
      Matches a temporal field that is equal to the specified value.
      Parameters:
      field - the temporal field
      value - the target value
      Returns:
      the matcher
    • fieldIsGreaterThan

      public static org.hamcrest.Matcher<Temporal> fieldIsGreaterThan(TemporalField field, int value)
      Matches a temporal field that is greater than the specified value.
      Parameters:
      field - the temporal field
      value - 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 field
      value - the target value
      Returns:
      the matcher
    • fieldIsLessThan

      public static org.hamcrest.Matcher<Temporal> fieldIsLessThan(TemporalField field, int value)
      Matches a temporal field that is less than the specified value.
      Parameters:
      field - the temporal field
      value - 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 field
      value - the target value
      Returns:
      the matcher
    • isInYear

      public static org.hamcrest.Matcher<Temporal> isInYear(int year)
      Matches a YEAR value with the specified value.
      Parameters:
      year - the year
      Returns:
      the matcher
    • isInMonth

      public static org.hamcrest.Matcher<Temporal> isInMonth(Month month)
      Matches a MONTH_OF_YEAR value with the specified value.
      Parameters:
      month - the month of the year
      Returns:
      the matcher
    • isInMonth

      public static org.hamcrest.Matcher<Temporal> isInMonth(int month)
      Matches a MONTH_OF_YEAR value with the specified value.
      Parameters:
      month - the month of the year
      Returns:
      the matcher
    • isInHourOfDay

      public static org.hamcrest.Matcher<Temporal> isInHourOfDay(int hour)
      Matches a HOUR_OF_DAY value with the specified value.
      Parameters:
      hour - the hour of the day
      Returns:
      the matcher
    • isInMorning

      public static org.hamcrest.Matcher<Temporal> isInMorning()
      Matches an HOUR_OF_DAY value after midnight and before noon.
      Returns:
      the matcher
    • isInAfternoon

      public static org.hamcrest.Matcher<Temporal> isInAfternoon()
      Matches an HOUR_OF_DAY value of noon or later, but before midnight.
      Returns:
      the matcher
    • isDayOfWeek

      public static org.hamcrest.Matcher<Temporal> isDayOfWeek(DayOfWeek dow)
      Matches a DAY_OF_WEEK value with the specified value.
      Parameters:
      dow - day of the week
      Returns:
      the matcher
    • isDayOfWeek

      public static org.hamcrest.Matcher<Temporal> isDayOfWeek(int dow)
      Matches a DAY_OF_WEEK value with the specified value.
      Parameters:
      dow - day of the week
      Returns:
      the matcher
    • isWeekday

      public static org.hamcrest.Matcher<Temporal> isWeekday()
      Matches a DAY_OF_WEEK value for a weekday (i.e. MONDAY through FRIDAY inclusive).
      Returns:
      the matcher
    • isWeekend

      public static org.hamcrest.Matcher<Temporal> isWeekend()
      Matches a DAY_OF_WEEK value for a weekend (i.e. SATURDAY or SUNDAY).
      Returns:
      the matcher
    • matches

      public boolean matches(Object actual)
    • describeTo

      public void describeTo(org.hamcrest.Description description)