T
- The type of object being matched.Matcher<T>
, SelfDescribing
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.
for a type safe variant of this class that you probably
want to use.
Constructor | Description |
---|---|
CustomMatcher(java.lang.String description) |
Modifier and Type | Method | Description |
---|---|---|
void |
describeTo(Description description) |
Generates a description of the object.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
public final void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.