public class Every<T> extends TypeSafeDiagnosingMatcher<Iterable<T>>
Modifier and Type | Method and Description |
---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
static <U> Matcher<Iterable<U>> |
everyItem(Matcher<U> itemMatcher)
|
boolean |
matchesSafely(Iterable<T> collection,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public boolean matchesSafely(Iterable<T> collection, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<Iterable<T>>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static <U> Matcher<Iterable<U>> everyItem(Matcher<U> itemMatcher)
Iterable
s that only matches when a single pass over the
examined Iterable
yields items that are all matched by the specified
itemMatcher
.
For example:
assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
itemMatcher
- the matcher to apply to every item provided by the examined Iterable