* * *

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

##  org.hamcrest  
Class TypeSafeDiagnosingMatcher<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.TypeSafeDiagnosingMatcher <T>**
    

**Type Parameters:**      ` 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:**      [ CombinableMatcher
](../../org/hamcrest/core/CombinableMatcher.html "class in org.hamcrest.core")
, [ Every ](../../org/hamcrest/core/Every.html "class in org.hamcrest.core") ,
[ FeatureMatcher ](../../org/hamcrest/FeatureMatcher.html "class in
org.hamcrest") , [ HasPropertyWithValue
](../../org/hamcrest/beans/HasPropertyWithValue.html "class in
org.hamcrest.beans") , [ HasXPath ](../../org/hamcrest/xml/HasXPath.html
"class in org.hamcrest.xml") , [ IsCollectionContaining
](../../org/hamcrest/core/IsCollectionContaining.html "class in
org.hamcrest.core") , [ IsEventFrom
](../../org/hamcrest/object/IsEventFrom.html "class in org.hamcrest.object") ,
[ IsIterableContainingInAnyOrder
](../../org/hamcrest/collection/IsIterableContainingInAnyOrder.html "class in
org.hamcrest.collection") , [ IsIterableContainingInOrder
](../../org/hamcrest/collection/IsIterableContainingInOrder.html "class in
org.hamcrest.collection") , [ SamePropertyValuesAs
](../../org/hamcrest/beans/SamePropertyValuesAs.html "class in
org.hamcrest.beans")

* * *
    
    
    public abstract class **TypeSafeDiagnosingMatcher <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 and that will report why the received value has been rejected. This
implements the null check, checks the type and then casts. To use, implement

    
    
    matchesSafely()

.

**Author:**

     Neil Dunn, Nat Pryce, Steve Freeman 

* * *

**Constructor Summary**  
---  
` protected ` |  ` **[ TypeSafeDiagnosingMatcher ](../../org/hamcrest/TypeSafeDiagnosingMatcher.html#TypeSafeDiagnosingMatcher\(\)) ** () `   
The default constructor for simple sub types  
` protected ` |  ` **[ TypeSafeDiagnosingMatcher ](../../org/hamcrest/TypeSafeDiagnosingMatcher.html#TypeSafeDiagnosingMatcher\(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 ` |  ` **[ TypeSafeDiagnosingMatcher ](../../org/hamcrest/TypeSafeDiagnosingMatcher.html#TypeSafeDiagnosingMatcher\(org.hamcrest.internal.ReflectiveTypeFinder\)) ** ( [ ReflectiveTypeFinder ](../../org/hamcrest/internal/ReflectiveTypeFinder.html "class in org.hamcrest.internal") typeFinder) `   
Use this constructor if the subclass that implements ` matchesSafely ` is
_not_ the class that binds <T> to a type.  
**Method Summary**  
---  
` void ` |  ` **[ describeMismatch ](../../org/hamcrest/TypeSafeD