T
- The type of the object to be matchedU
- The type of the feature to be matchedpublic abstract class FeatureMatcher<T,U> extends TypeSafeDiagnosingMatcher<T>
featureValueOf()
in a subclass to pull out the feature to be matched against.Constructor and Description |
---|
FeatureMatcher(Matcher<? super U> subMatcher,
String featureDescription,
String featureName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
protected abstract U |
featureValueOf(T actual)
Implement this to extract the interesting feature.
|
protected boolean |
matchesSafely(T actual,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
protected abstract U featureValueOf(T actual)
actual
- the target objectprotected boolean matchesSafely(T actual, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<T>
public final void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.Copyright © 2016. All rights reserved.