T - public abstract class TypeSafeDiagnosingMatcher<T> extends BaseMatcher<T>
matchesSafely().
| Modifier | Constructor and Description |
|---|---|
protected |
TypeSafeDiagnosingMatcher()
The default constructor for simple sub types
|
protected |
TypeSafeDiagnosingMatcher(java.lang.Class<?> expectedType)
Use this constructor if the subclass that implements
matchesSafely
is not the class that binds <T> to a type. |
protected |
TypeSafeDiagnosingMatcher(ReflectiveTypeFinder typeFinder)
Use this constructor if the subclass that implements
matchesSafely
is not the class that binds <T> to a type. |
| Modifier and Type | Method and Description |
|---|---|
void |
describeMismatch(java.lang.Object item,
Description mismatchDescription)
Generate a description of why the matcher has not accepted the item.
|
boolean |
matches(java.lang.Object item)
Evaluates the matcher for argument item.
|
protected abstract boolean |
matchesSafely(T item,
Description mismatchDescription)
Subclasses should implement this.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeToprotected TypeSafeDiagnosingMatcher(java.lang.Class<?> expectedType)
matchesSafely
is not the class that binds <T> to a type.expectedType - The expectedType of the actual value.protected TypeSafeDiagnosingMatcher(ReflectiveTypeFinder typeFinder)
matchesSafely
is not the class that binds <T> to a type.typeFinder - A type finder to extract the typeprotected TypeSafeDiagnosingMatcher()
protected abstract boolean matchesSafely(T item, Description mismatchDescription)
public final boolean matches(java.lang.Object item)
Matcheritem - the object against which the matcher is evaluated.true if item matches, otherwise false.BaseMatcherpublic final void describeMismatch(java.lang.Object item,
Description mismatchDescription)
Matchermatches(item) is false, but
will not check this.describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>item - The item that the Matcher has rejected.mismatchDescription - The description to be built or appended to.