java.lang.Object |
↳ |
org.hamcrest.BaseMatcher<T> |
|
↳ |
org.junit.internal.matchers.TypeSafeMatcher<T> |
Known Direct Subclasses
|
Known Indirect Subclasses
StringContains |
Tests if the argument is a string that contains a substring. |
|
Class Overview
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.
Summary
Public Methods |
final
boolean
|
matches(Object item)
Method made final to prevent accidental override.
|
abstract
boolean
|
matchesSafely(T item)
Subclasses should implement this.
|
[Expand]
Inherited Methods |
From class
org.hamcrest.BaseMatcher
final
void
|
_dont_implement_Matcher___instead_extend_BaseMatcher_()
|
String
|
toString()
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.hamcrest.Matcher
abstract
void
|
_dont_implement_Matcher___instead_extend_BaseMatcher_()
|
abstract
boolean
|
matches(Object arg0)
|
|
From interface
org.hamcrest.SelfDescribing
abstract
void
|
describeTo(Description arg0)
|
|
Protected Constructors
protected
TypeSafeMatcher
()
protected
TypeSafeMatcher
(Class<T> expectedType)
Public Methods
public
final
boolean
matches
(Object item)
Method made final to prevent accidental override.
If you need to override this, there's no point on extending TypeSafeMatcher.
Instead, extend the BaseMatcher.
public
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.