| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private final String | |
| private final Matcher | |
| private final Object[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> Matcher | describedAs(String
the new description for the wrapped matcher description, Matcher<T> the matcher to wrap matcher, Object... optional values to insert into the tokenised description values)Wraps an existing matcher, overriding its description with that specified. |
| public void | describeMismatch(Object
The item that the Matcher has rejected. item, Description The description to be built or appended to. description)Overrides org. Implements org. |
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| public boolean | matches(Object
the object against which the matcher is evaluated. o)Implements org. |
| ARG_PATTERN | back to summary |
|---|---|
| private static final Pattern ARG_PATTERN | |
| descriptionTemplate | back to summary |
|---|---|
| private final String descriptionTemplate | |
| matcher | back to summary |
|---|---|
| private final Matcher<T> matcher | |
| values | back to summary |
|---|---|
| private final Object[] values | |
| DescribedAs | back to summary |
|---|---|
| public DescribedAs(String descriptionTemplate, Matcher<T> matcher, Object[] values) | |
| describedAs | back to summary |
|---|---|
| public static <T> Matcher Wraps an existing matcher, overriding its description with that specified. All other functions are delegated to the decorated matcher, including its mismatch description. For example: describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
| |
| describeMismatch | back to summary |
|---|---|
| public void describeMismatch(Object item, Description description) Overrides org. Implements org. Doc from org. Generate a description of why the matcher has not accepted the item.
The description will be part of a larger description of why a matching
failed, so it should be concise.
This method assumes that
| |
| describeTo | back to summary |
|---|---|
| public 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.
| |
| matches | back to summary |
|---|---|
| public boolean matches(Object o) Implements org. Doc from org. Evaluates the matcher for argument item. This method matches against Object, instead of the generic type T. This is because the caller of the Matcher does not know at runtime what the type is (because of type erasure with Java generics). It is down to the implementations to check the correct type. | |