public class IsIn<T> extends BaseMatcher<T>
| Constructor and Description |
|---|
IsIn(java.util.Collection<T> collection) |
IsIn(T[] elements) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(Description buffer)
Generates a description of the object.
|
static <T> Matcher<T> |
isIn(java.util.Collection<T> collection)
Creates a matcher that matches when the examined object is found within the
specified collection.
|
static <T> Matcher<T> |
isIn(T[] elements)
Creates a matcher that matches when the examined object is found within the
specified array.
|
static <T> Matcher<T> |
isOneOf(T... elements)
Creates a matcher that matches when the examined object is equal to one of the
specified elements.
|
boolean |
matches(java.lang.Object o)
Evaluates the matcher for argument item.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toStringpublic IsIn(java.util.Collection<T> collection)
public IsIn(T[] elements)
public boolean matches(java.lang.Object o)
Matchero - the object against which the matcher is evaluated.true if item matches, otherwise false.BaseMatcherpublic void describeTo(Description buffer)
SelfDescribingbuffer - The description to be built or appended to.public static <T> Matcher<T> isIn(java.util.Collection<T> collection)
assertThat("foo", isIn(Arrays.asList("bar", "foo")))collection - the collection in which matching items must be foundpublic static <T> Matcher<T> isIn(T[] elements)
assertThat("foo", isIn(new String[]{"bar", "foo"}))elements - the array in which matching items must be foundpublic static <T> Matcher<T> isOneOf(T... elements)
assertThat("foo", isIn("bar", "foo"))elements - the elements amongst which matching items will be found