Class Matchers.ComposingMatcher<F,​T>

  • Type Parameters:
    F - From type: the type of value to be matched
    T - To type: type returned by function, and the resulting matcher
    All Implemented Interfaces:
    org.hamcrest.Matcher<F>, org.hamcrest.SelfDescribing
    Enclosing class:

    private static class Matchers.ComposingMatcher<F,​T>
    extends org.hamcrest.TypeSafeMatcher<F>
    Matcher that transforms the input value using a function before passing to another matcher.
    • Field Summary

      Modifier and Type Field Description
      private java.util.function.Function<F,​T> f  
      private org.hamcrest.Matcher<T> matcher  
    • Constructor Summary

      Constructor Description
      ComposingMatcher​(org.hamcrest.Matcher<T> matcher, java.util.function.Function<F,​T> f)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void describeMismatchSafely​(F item, org.hamcrest.Description mismatchDescription)  
      void describeTo​(org.hamcrest.Description description)  
      protected boolean matchesSafely​(F item)  
      • Methods inherited from class org.hamcrest.TypeSafeMatcher

        describeMismatch, matches
      • Methods inherited from class org.hamcrest.BaseMatcher

        _dont_implement_Matcher___instead_extend_BaseMatcher_, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • matcher

        private final org.hamcrest.Matcher<T> matcher
      • f

        private final java.util.function.Function<F,​T> f
    • Constructor Detail

      • ComposingMatcher

        ComposingMatcher​(org.hamcrest.Matcher<T> matcher,
                         java.util.function.Function<F,​T> f)
    • Method Detail

      • matchesSafely

        protected boolean matchesSafely​(F item)
        Specified by:
        matchesSafely in class org.hamcrest.TypeSafeMatcher<F>
      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • describeMismatchSafely

        protected void describeMismatchSafely​(F item,
                                              org.hamcrest.Description mismatchDescription)
        describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<F>