Package org.junit.internal.matchers
Class TypeSafeMatcher<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.junit.internal.matchers.TypeSafeMatcher<T>
- All Implemented Interfaces:
org.hamcrest.Matcher<T>,org.hamcrest.SelfDescribing
Deprecated.
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.protectedTypeSafeMatcher(Class<T> expectedType) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate static Class<?> findExpectedType(Class<?> fromClass) Deprecated.private static booleanisMatchesSafelyMethod(Method method) Deprecated.final booleanDeprecated.Method made final to prevent accidental override.abstract booleanmatchesSafely(T item) Deprecated.Subclasses should implement this.Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hamcrest.SelfDescribing
describeTo
-
Field Details
-
expectedType
Deprecated.
-
-
Constructor Details
-
TypeSafeMatcher
protected TypeSafeMatcher()Deprecated. -
TypeSafeMatcher
Deprecated.
-
-
Method Details
-
matchesSafely
Deprecated.Subclasses should implement this. The item will already have been checked for the specific type and will never be null. -
findExpectedType
Deprecated. -
isMatchesSafelyMethod
Deprecated. -
matches
Deprecated.Method made final to prevent accidental override. If you need to override this, there's no point on extending TypeSafeMatcher. Instead, extend theBaseMatcher.
-
TypeSafeMatcher.