|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hamcrest.BaseMatcher<T> org.hamcrest.collection.IsIn<T>
public class IsIn<T>
Constructor Summary | |
---|---|
IsIn(java.util.Collection<T> collection)
|
|
IsIn(T[] elements)
|
Method Summary | ||
---|---|---|
void |
describeTo(Description buffer)
Generates a description of the object. |
|
static
|
isIn(java.util.Collection<T> collection)
Creates a matcher that matches when the examined object is found within the specified collection. |
|
static
|
isIn(T[] elements)
Creates a matcher that matches when the examined object is found within the specified array. |
|
static
|
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. |
Methods inherited from class org.hamcrest.BaseMatcher |
---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IsIn(java.util.Collection<T> collection)
public IsIn(T[] elements)
Method Detail |
---|
public boolean matches(java.lang.Object o)
Matcher
o
- the object against which the matcher is evaluated.
true
if item matches, otherwise false
.BaseMatcher
public void describeTo(Description buffer)
SelfDescribing
buffer
- 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |