Class TypeSafeMatcher<T>

  • All Implemented Interfaces:
    org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

    @Deprecated
    public abstract class TypeSafeMatcher<T>
    extends org.hamcrest.BaseMatcher<T>
    Deprecated.
    Please use TypeSafeMatcher.
    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
    • Constructor Detail

      • TypeSafeMatcher

        protected TypeSafeMatcher()
        Deprecated.
      • TypeSafeMatcher

        protected TypeSafeMatcher​(Class<T> expectedType)
        Deprecated.
    • Method Detail

      • matchesSafely

        public abstract boolean matchesSafely​(T item)
        Deprecated.
        Subclasses should implement this. The item will already have been checked for the specific type and will never be null.
      • matches

        public final boolean matches​(Object item)
        Deprecated.
        Method made final to prevent accidental override. If you need to override this, there's no point on extending TypeSafeMatcher. Instead, extend the BaseMatcher.