| org.junit.matchers.TypeSafeMatcher
TypeSafeMatcher | abstract public class TypeSafeMatcher extends BaseMatcher (Code) | | Convenient base class for Matchers that require a non-null value of a specific type.
This simply implements the null check, checks the type and then casts.
author: Joe Walnes |
Method Summary | |
final public boolean | matches(Object item) Method made final to prevent accidental override. | abstract public boolean | matchesSafely(T item) Subclasses should implement this. |
TypeSafeMatcher | protected TypeSafeMatcher()(Code) | | |
TypeSafeMatcher | protected TypeSafeMatcher(Class<T> expectedType)(Code) | | |
matches | final public boolean matches(Object item)(Code) | | Method made final to prevent accidental override.
If you need to override this, there's no point on extending TypeSafeMatcher.
Instead, extend the
BaseMatcher .
|
matchesSafely | abstract public boolean matchesSafely(T item)(Code) | | Subclasses should implement this. The item will already have been checked for
the specific type and will never be null.
|
|
|