T
- The subject type of the new matcher.U
- The subject type of the original delegate matcher.public class DelegatingMatcher<T,U>
extends org.hamcrest.TypeSafeMatcher<T>
Given a matcher that accepts a type U, constructs a matcher that accepts a type T where T is some type that can access a U.
For example, given that U is a type UpgradeState, and T is a type ClusterNode, we can create a matcher that accepts a ClusterNode by providing 1) a matcher that accepts an UpgradeState; and 2) a function that maps a ClusterNode on to an Upgrade State.
ClusterStateMatchers
Modifier and Type | Method and Description |
---|---|
protected void |
describeMismatchSafely(T item,
org.hamcrest.Description mismatchDescription) |
void |
describeTo(org.hamcrest.Description description) |
protected boolean |
matchesSafely(T subject) |
static <T,U> org.hamcrest.TypeSafeMatcher<T> |
matchWithDelegate(java.util.function.Function<T,U> valueSupplier,
org.hamcrest.Matcher<U> delegateMatcher) |
public static final <T,U> org.hamcrest.TypeSafeMatcher<T> matchWithDelegate(java.util.function.Function<T,U> valueSupplier, org.hamcrest.Matcher<U> delegateMatcher)
protected boolean matchesSafely(T subject)
matchesSafely
in class org.hamcrest.TypeSafeMatcher<T>
public void describeTo(org.hamcrest.Description description)
Copyright © 2002-2022 Atlassian. All Rights Reserved.