Matcher<T[]>, SelfDescribingpublic class IsArray<T> extends TypeSafeMatcher<T[]>
| Constructor | Description |
|---|---|
IsArray(Matcher<? super T>[] elementMatchers) |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> IsArray<T> |
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.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeMismatch, matchespublic boolean matchesSafely(T[] array)
TypeSafeMatchermatchesSafely in class TypeSafeMatcher<T[]>public void describeMismatchSafely(T[] actual, Description mismatchDescription)
TypeSafeMatcherdescribeMismatchSafely in class TypeSafeMatcher<T[]>public void describeTo(Description description)
SelfDescribingdescription - 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