public class IsArray<T> extends TypeSafeMatcher<T[]>
Constructor and Description |
---|
IsArray(Matcher<? super T>[] elementMatchers) |
Modifier and Type | Method and 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.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
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