|
||||||||||
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.TypeSafeMatcher<T[]> org.hamcrest.collection.IsArray<T>
public class IsArray<T>
Matcher for array whose elements satisfy a sequence of matchers. The array size must equal the number of element matchers.
Constructor Summary | |
---|---|
IsArray(Matcher<? super T>[] elementMatchers)
|
Method Summary | ||
---|---|---|
static
|
array(Matcher<? super T>... elementMatchers)
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
|
void |
describeMismatchSafely(T[] actual,
Description mismatchDescription)
Subclasses should override this. |
|
void |
describeTo(Description description)
Generates a description of the object. |
|
protected java.lang.String |
descriptionEnd()
Returns the string that ends the description. |
|
protected java.lang.String |
descriptionSeparator()
Returns the string that separates the elements in the description. |
|
protected java.lang.String |
descriptionStart()
Returns the string that starts the description. |
|
boolean |
matchesSafely(T[] array)
Subclasses should implement this. |
Methods inherited from class org.hamcrest.TypeSafeMatcher |
---|
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 |
Constructor Detail |
---|
public IsArray(Matcher<? super T>[] elementMatchers)
Method Detail |
---|
public boolean matchesSafely(T[] array)
TypeSafeMatcher
matchesSafely
in class TypeSafeMatcher<T[]>
public void describeMismatchSafely(T[] actual, Description mismatchDescription)
TypeSafeMatcher
describeMismatchSafely
in class TypeSafeMatcher<T[]>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.protected java.lang.String descriptionStart()
protected java.lang.String descriptionSeparator()
protected java.lang.String descriptionEnd()
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
assertThat(new Integer[]{1,2,3}, is(array(equalTo(1), equalTo(2), equalTo(3))))
elementMatchers
- the matchers that the elements of examined arrays should satisfy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |