Class LambdaMatcher<Testee,Feature>

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeDiagnosingMatcher<T>
org.hamcrest.FeatureMatcher<Testee,Feature>
org.dmfs.jems2.hamcrest.matchers.LambdaMatcher<Testee,Feature>
All Implemented Interfaces:
org.hamcrest.Matcher<Testee>, org.hamcrest.SelfDescribing

public final class LambdaMatcher<Testee,Feature> extends org.hamcrest.FeatureMatcher<Testee,Feature>
A version of a FeatureMatcher which takes a delegate Function instead of requiring to override it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LambdaMatcher(org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher, String featureDescription, String featureName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Feature
     
    static <Testee, Feature>
    org.hamcrest.Matcher<Testee>
    having(String name, org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher)
     
    static <Testee, Feature>
    org.hamcrest.Matcher<Testee>
    having(org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher)
     

    Methods inherited from class org.hamcrest.FeatureMatcher

    describeTo, matchesSafely

    Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher

    describeMismatch, matches

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LambdaMatcher

      public LambdaMatcher(org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher, String featureDescription, String featureName)
  • Method Details

    • having

      public static <Testee, Feature> org.hamcrest.Matcher<Testee> having(String name, org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher)
    • having

      public static <Testee, Feature> org.hamcrest.Matcher<Testee> having(org.dmfs.jems2.Function<Testee,Feature> function, org.hamcrest.Matcher<? super Feature> subMatcher)
    • featureValueOf

      protected Feature featureValueOf(Testee actual)
      Specified by:
      featureValueOf in class org.hamcrest.FeatureMatcher<Testee,Feature>