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> |
in(java.util.Collection<T> collection)
Creates a matcher that matches when the examined object is found within the
specified collection.
|
static <T> Matcher<T> |
in(T[] elements)
Creates a matcher that matches when the examined object is found within the
specified array.
|
static <T> Matcher<T> |
isIn(java.util.Collection<T> collection)
Deprecated.
use is(in(...)) instead
|
static <T> Matcher<T> |
isIn(T[] elements)
Deprecated.
use is(in(...)) instead
|
static <T> Matcher<T> |
isOneOf(T... elements)
Deprecated.
use is(oneOf(...)) instead
|
boolean |
matches(java.lang.Object o)
Evaluates the matcher for argument item.
|
static <T> Matcher<T> |
oneOf(T... elements)
Creates a matcher that matches when the examined object is equal to one of the
specified elements.
|
_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.@Deprecated 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> in(java.util.Collection<T> collection)
assertThat("foo", is(in(Arrays.asList("bar", "foo"))))collection - the collection in which matching items must be found@Deprecated public 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> in(T[] elements)
assertThat("foo", is(in(new String[]{"bar", "foo"})))elements - the array in which matching items must be found@Deprecated public static <T> Matcher<T> isOneOf(T... elements)
assertThat("foo", isOneOf("bar", "foo"))elements - the elements amongst which matching items will be foundpublic static <T> Matcher<T> oneOf(T... elements)
assertThat("foo", is(oneOf("bar", "foo")))elements - the elements amongst which matching items will be found