public class TimeMatchers extends Object
| Constructor and Description |
|---|
TimeMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<T> & java.time.temporal.Temporal> |
after(T time)
Matches a time strictly after that given
|
static <T extends Comparable<T> & java.time.temporal.Temporal> |
before(T time)
Matches a time strictly before that given
|
static <T extends Comparable<T>> |
between(T earlierOrEqual,
T laterOrEqual)
Matches a Comparable value greater than or equal to the first given value and less than or
equal to the second given value
|
static <T extends Comparable<T> & java.time.temporal.TemporalAmount> |
longerThan(T amount)
Matches an amount of time strictly longer than that specified
|
static org.hamcrest.Matcher<java.time.Period> |
matches(org.hamcrest.Matcher<Integer> yearsMatcher,
org.hamcrest.Matcher<Integer> monthsMatcher,
org.hamcrest.Matcher<Integer> daysMatcher)
Matches any Period for which the years, months and days match the provided matchers
|
static <T extends Comparable<T> & java.time.temporal.TemporalAmount> |
shorterThan(T amount)
Matches an amount of time strictly shorter than that specified
|
public static <T extends Comparable<T> & java.time.temporal.Temporal> org.hamcrest.Matcher<T> after(T time)
T - The type of time, e.g. Instant or LocalDateTimetime - Time for comparisonpublic static <T extends Comparable<T> & java.time.temporal.Temporal> org.hamcrest.Matcher<T> before(T time)
T - The type of time, e.g. Instant or LocalDateTimetime - Time for comparisonpublic static <T extends Comparable<T>> org.hamcrest.Matcher<T> between(T earlierOrEqual, T laterOrEqual)
T - The type to compare, e.g. Temporal or TemporalAmountpublic static <T extends Comparable<T> & java.time.temporal.TemporalAmount> org.hamcrest.Matcher<T> longerThan(T amount)
T - The type to compare, typically Durationamount - amount of time for comparisonpublic static <T extends Comparable<T> & java.time.temporal.TemporalAmount> org.hamcrest.Matcher<T> shorterThan(T amount)
T - The type to compare, typically Durationamount - amount of time for comparisonCopyright © 2018. All rights reserved.