public class IsIterableContainingInRelativeOrder<E> extends TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>
Constructor and Description |
---|
IsIterableContainingInRelativeOrder(java.util.List<Matcher<? super E>> matchers) |
Modifier and Type | Method and Description |
---|---|
static <E> Matcher<java.lang.Iterable<? extends E>> |
containsInRelativeOrder(E... items)
Creates a matcher for
Iterable s that matches when a single pass over the
examined Iterable yields a series of items, that contains items logically equal to the
corresponding item in the specified items, in the same relative order
For example: |
static <E> Matcher<java.lang.Iterable<? extends E>> |
containsInRelativeOrder(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for
Iterable s that matches when a single pass over the
examined Iterable yields a series of items, that contains items satisfying the corresponding
matcher in the specified list of matchers, in the same relative order. |
static <E> Matcher<java.lang.Iterable<? extends E>> |
containsInRelativeOrder(Matcher<? super E>... itemMatchers)
Creates a matcher for
Iterable s that matches when a single pass over the
examined Iterable yields a series of items, that each satisfying the corresponding
matcher in the specified matchers, in the same relative order. |
void |
describeTo(Description description)
Generates a description of the object.
|
protected boolean |
matchesSafely(java.lang.Iterable<? extends E> iterable,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
protected boolean matchesSafely(java.lang.Iterable<? extends E> iterable, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.@SafeVarargs public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(E... items)
Iterable
s that matches when a single pass over the
examined Iterable
yields a series of items, that contains items logically equal to the
corresponding item in the specified items, in the same relative order
For example:
assertThat(Arrays.asList("a", "b", "c", "d", "e"), containsInRelativeOrder("b", "d"))
items
- the items that must be contained within items provided by an examined Iterable
in the same relative order@SafeVarargs public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(Matcher<? super E>... itemMatchers)
Iterable
s that matches when a single pass over the
examined Iterable
yields a series of items, that each satisfying the corresponding
matcher in the specified matchers, in the same relative order.
For example:
assertThat(Arrays.asList("a", "b", "c", "d", "e"), containsInRelativeOrder(equalTo("b"), equalTo("d")))
itemMatchers
- the matchers that must be satisfied by the items provided by an examined Iterable
in the same relative orderpublic static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(java.util.List<Matcher<? super E>> itemMatchers)
Iterable
s that matches when a single pass over the
examined Iterable
yields a series of items, that contains items satisfying the corresponding
matcher in the specified list of matchers, in the same relative order.
For example:
assertThat(Arrays.asList("a", "b", "c", "d", "e"), contains(Arrays.asList(equalTo("b"), equalTo("d"))))
itemMatchers
- a list of matchers, each of which must be satisfied by the items provided by
an examined Iterable
in the same relative order