org.hamcrest.collection
Class IsIterableContainingInOrder<E>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>
org.hamcrest.collection.IsIterableContainingInOrder<E>
- All Implemented Interfaces:
- org.hamcrest.Matcher<java.lang.Iterable<? extends E>>, org.hamcrest.SelfDescribing
public class IsIterableContainingInOrder<E>
- extends org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>
Method Summary |
static
<E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> |
|
contains(E... items)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each logically equal to the
corresponding item in the specified items. |
static
<E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> |
|
contains(java.util.List<org.hamcrest.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, each satisfying the corresponding
matcher in the specified list of matchers. |
static
<E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> |
|
contains(org.hamcrest.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, each satisfying the corresponding
matcher in the specified matchers. |
static
<E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> |
|
contains(org.hamcrest.Matcher<? super E> itemMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a single item that satisfies the specified matcher. |
void |
describeTo(org.hamcrest.Description description)
|
protected boolean |
matchesSafely(java.lang.Iterable<? extends E> iterable,
org.hamcrest.Description mismatchDescription)
|
Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher |
describeMismatch, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IsIterableContainingInOrder
public IsIterableContainingInOrder(java.util.List<org.hamcrest.Matcher<? super E>> matchers)
matchesSafely
protected boolean matchesSafely(java.lang.Iterable<? extends E> iterable,
org.hamcrest.Description mismatchDescription)
- Specified by:
matchesSafely
in class org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>
describeTo
public void describeTo(org.hamcrest.Description description)
contains
public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains(E... items)
- Creates a matcher for
Iterable
s that matches when a single pass over the
examined Iterable
yields a series of items, each logically equal to the
corresponding item in the specified items. For a positive match, the examined iterable
must be of the same length as the number of specified items.
For example:
assertThat(Arrays.asList("foo", "bar"), contains("foo", "bar"))
- Parameters:
items
- the items that must equal the items provided by an examined Iterable
contains
public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains(org.hamcrest.Matcher<? super E> itemMatcher)
- Creates a matcher for
Iterable
s that matches when a single pass over the
examined Iterable
yields a single item that satisfies the specified matcher.
For a positive match, the examined iterable must only yield one item.
For example:
assertThat(Arrays.asList("foo"), contains(equalTo("foo")))
- Parameters:
itemMatcher
- the matcher that must be satisfied by the single item provided by an
examined Iterable
contains
public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains(org.hamcrest.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, each satisfying the corresponding
matcher in the specified matchers. For a positive match, the examined iterable
must be of the same length as the number of specified matchers.
For example:
assertThat(Arrays.asList("foo", "bar"), contains(equalTo("foo"), equalTo("bar")))
- Parameters:
itemMatchers
- the matchers that must be satisfied by the items provided by an examined Iterable
contains
public static <E> org.hamcrest.Matcher<java.lang.Iterable<? extends E>> contains(java.util.List<org.hamcrest.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, each satisfying the corresponding
matcher in the specified list of matchers. For a positive match, the examined iterable
must be of the same length as the specified list of matchers.
For example:
assertThat(Arrays.asList("foo", "bar"), contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))
- Parameters:
itemMatchers
- a list of matchers, each of which must be satisfied by the corresponding item provided by
an examined Iterable