public class MatchesFunction<T,R> extends BaseMatcher<T>
T
with another (matched) object, compares
the values of type R
derived using a specified function. To compare function values,
uses a Matcher derived from the source object using a specified "result Matcher supplier" function.Modifier and Type | Class and Description |
---|---|
static class |
MatchesFunction.Builder<T,R>
Defines a fluent interface for building a
MatchesFunction matcher. |
static class |
MatchesFunction.Supplier<T,R>
Builds and supplies a
MatchesFunction matcher for a specified source object. |
Constructor and Description |
---|
MatchesFunction(String functionName,
Function<T,R> function,
T source,
Function<R,Matcher<R>> resultMatcherSupplier)
Creates a new MatchesFunction instance.
|
Modifier and Type | Method and Description |
---|---|
void |
describeMismatch(Object actual,
Description description) |
void |
describeTo(Description description) |
String |
getFunctionName()
Returns the function name for this matcher.
|
boolean |
matches(Object actual) |
String |
toString() |
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull
public String getFunctionName()
public boolean matches(Object actual)
public void describeTo(Description description)
public void describeMismatch(Object actual, Description description)
describeMismatch
in interface Matcher<T>
describeMismatch
in class BaseMatcher<T>
public String toString()
toString
in class BaseMatcher<T>
Copyright © 2022 The Cornutum Project. All rights reserved.