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.
| Modifier and Type | Field and Description |
|---|---|
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| fixedDescription | back to summary |
|---|---|
| private final String fixedDescription | |
| CustomMatcher | back to summary |
|---|---|
| public CustomMatcher(String description) | |
| describeTo | back to summary |
|---|---|
| public final void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |