| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| private static final ReflectiveTypeFinder |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | TypeSafeMatcher(Class<?>
The expectedType of the actual value. expectedType)Use this constructor if the subclass that implements |
| protected | TypeSafeMatcher(ReflectiveTypeFinder
A type finder to extract the type typeFinder)Use this constructor if the subclass that implements |
| Modifier and Type | Method and Description |
|---|---|
| public final 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. |
| protected void | |
| public final boolean | matches(Object
the object against which the matcher is evaluated. item)Implements org. |
| protected abstract boolean |
| expectedType | back to summary |
|---|---|
| private final Class<?> expectedType | |
| TYPE_FINDER | back to summary |
|---|---|
| private static final ReflectiveTypeFinder TYPE_FINDER | |
| TypeSafeMatcher | back to summary |
|---|---|
| protected TypeSafeMatcher() The default constructor for simple sub types | |
| TypeSafeMatcher | back to summary |
|---|---|
| protected TypeSafeMatcher(Class<?> expectedType) Use this constructor if the subclass that implements
| |
| TypeSafeMatcher | back to summary |
|---|---|
| protected TypeSafeMatcher(ReflectiveTypeFinder typeFinder) Use this constructor if the subclass that implements
| |
| describeMismatch | back to summary |
|---|---|
| public final 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
| |
| describeMismatchSafely | back to summary |
|---|---|
| protected void describeMismatchSafely(T item, Description mismatchDescription) Subclasses should override this. The item will already have been checked for the specific type and will never be null. | |
| matches | back to summary |
|---|---|
| public final boolean matches(Object item) Implements org. Methods made final to prevent accidental override.
If you need to override this, there's no point on extending TypeSafeMatcher.
Instead, extend the
| |
| matchesSafely | back to summary |
|---|---|
| protected abstract boolean matchesSafely(T item) Subclasses should implement this. The item will already have been checked for the specific type and will never be null. | |