E - type to match againstR - post-transformation type of delegate matcherpublic class TransformingMatcher<E,R>
extends org.hamcrest.TypeSafeMatcher<E>
The advantage of this over transforming the value inside the test code is that it can be re-used while maintaining the familiar syntax of hamcrest assertThat.
| Modifier | Constructor and Description |
|---|---|
protected |
TransformingMatcher(Function<E,R> transformation,
org.hamcrest.Matcher<R> matcher) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
describeMismatchSafely(E item,
org.hamcrest.Description mismatchDescription) |
void |
describeTo(org.hamcrest.Description description) |
static <E,R> TransformingMatcher<E,R> |
hasDerivedValue(Function<E,R> transformation,
org.hamcrest.Matcher<R> matcher) |
protected boolean |
matchesSafely(E e) |
public static <E,R> TransformingMatcher<E,R> hasDerivedValue(Function<E,R> transformation, org.hamcrest.Matcher<R> matcher)
protected boolean matchesSafely(E e)
matchesSafely in class org.hamcrest.TypeSafeMatcher<E>public void describeTo(org.hamcrest.Description description)
Copyright © 2013–2018 Hotels.com. All rights reserved.