* * *

|  [ **Overview** ](../../overview-summary.html) |  [ **Package** ](package-summary.html) |  **Class** |  [ **Use** ](class-use/TypeSafeMatcher.html) |  [ **Tree** ](package-tree.html) |  [ **Deprecated** ](../../deprecated-list.html) |  [ **Index** ](../../index-all.html) |  [ **Help** ](../../help-doc.html)  
---|---|---|---|---|---|---|---  
__  
[ **PREV CLASS** ](../../org/hamcrest/TypeSafeDiagnosingMatcher.html "class in org.hamcrest") NEXT CLASS  |  [ **FRAMES** ](../../index.html?org/hamcrest/TypeSafeMatcher.html) [ **NO FRAMES** ](TypeSafeMatcher.html) [ **All Classes** ](../../allclasses-noframe.html)  
SUMMARY: NESTED | FIELD |  CONSTR  |  METHOD  |  DETAIL: FIELD |  CONSTR  |  METHOD   
  
* * *

##  org.hamcrest  
Class TypeSafeMatcher<T>

    
    
    java.lang.Object
      ![extended by ](../../resources/inherit.gif)[org.hamcrest.BaseMatcher](../../org/hamcrest/BaseMatcher.html "class in org.hamcrest")<T>
          ![extended by ](../../resources/inherit.gif)**org.hamcrest.TypeSafeMatcher <T>**
    

**All Implemented Interfaces:**      [ Matcher
](../../org/hamcrest/Matcher.html "interface in org.hamcrest") <T>, [
SelfDescribing ](../../org/hamcrest/SelfDescribing.html "interface in
org.hamcrest")

**Direct Known Subclasses:**      [ BigDecimalCloseTo
](../../org/hamcrest/number/BigDecimalCloseTo.html "class in
org.hamcrest.number") , [ CustomTypeSafeMatcher
](../../org/hamcrest/CustomTypeSafeMatcher.html "class in org.hamcrest") , [
HasProperty ](../../org/hamcrest/beans/HasProperty.html "class in
org.hamcrest.beans") , [ IsArray ](../../org/hamcrest/collection/IsArray.html
"class in org.hamcrest.collection") , [ IsArrayContaining
](../../org/hamcrest/collection/IsArrayContaining.html "class in
org.hamcrest.collection") , [ IsArrayContainingInAnyOrder
](../../org/hamcrest/collection/IsArrayContainingInAnyOrder.html "class in
org.hamcrest.collection") , [ IsArrayContainingInOrder
](../../org/hamcrest/collection/IsArrayContainingInOrder.html "class in
org.hamcrest.collection") , [ IsCloseTo
](../../org/hamcrest/number/IsCloseTo.html "class in org.hamcrest.number") , [
IsCompatibleType ](../../org/hamcrest/object/IsCompatibleType.html "class in
org.hamcrest.object") , [ IsEmptyCollection
](../../org/hamcrest/collection/IsEmptyCollection.html "class in
org.hamcrest.collection") , [ IsEmptyIterable
](../../org/hamcrest/collection/IsEmptyIterable.html "class in
org.hamcrest.collection") , [ IsEqualIgnoringCase
](../../org/hamcrest/text/IsEqualIgnoringCase.html "class in
org.hamcrest.text") , [ IsEqualIgnoringWhiteSpace
](../../org/hamcrest/text/IsEqualIgnoringWhiteSpace.html "class in
org.hamcrest.text") , [ IsMapContaining
](../../org/hamcrest/collection/IsMapContaining.html "class in
org.hamcrest.collection") , [ OrderingComparison
](../../org/hamcrest/number/OrderingComparison.html "class in
org.hamcrest.number") , [ StringContainsInOrder
](../../org/hamcrest/text/StringContainsInOrder.html "class in
org.hamcrest.text") , [ SubstringMatcher
](../../org/hamcrest/core/SubstringMatcher.html "class in org.hamcrest.core")

* * *
    
    
    public abstract class **TypeSafeMatcher <T>**extends [BaseMatcher](../../org/hamcrest/BaseMatcher.html "class in org.hamcrest")<T>

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, Steve Freeman, Nat Pryce 

* * *

**Constructor Summary**  
---  
` protected ` |  ` **[ TypeSafeMatcher ](../../org/hamcrest/TypeSafeMatcher.html#TypeSafeMatcher\(\)) ** () `   
The default constructor for simple sub types  
` protected ` |  ` **[ TypeSafeMatcher ](../../org/hamcrest/TypeSafeMatcher.html#TypeSafeMatcher\(java.lang.Class\)) ** (java.lang.Class<?> expectedType) `   
Use this constructor if the subclass that implements ` matchesSafely ` is
_not_ the class that binds <T> to a type.  
` protected ` |  ` **[ TypeSafeMatcher ](../../org/hamcrest/Ty