T - The type of object being matched.public abstract class CustomMatcher<T> extends BaseMatcher<T>
Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
public boolean matches(Object object) {
return ((object instanceof String) && !((String) object).isEmpty();
}
};
This class is designed for scenarios where an anonymous inner class matcher makes sense. It should not be used by API designers implementing matchers.
| Constructor and Description |
|---|
CustomMatcher(java.lang.String description) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toStringpublic final void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.