T - The type of the object to be matchedU - The type of the feature to be matchedMatcher<T>, SelfDescribingHasToString, IsArrayWithSize, IsCollectionWithSize, IsIterableWithSizepublic abstract class FeatureMatcher<T,U> extends TypeSafeDiagnosingMatcher<T>
featureValueOf()
in a subclass to pull out the feature to be matched against.| Constructor | Description |
|---|---|
FeatureMatcher(Matcher<? super U> subMatcher,
java.lang.String featureDescription,
java.lang.String featureName) |
Constructor
|
| Modifier and Type | Method | 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 mismatch) |
Subclasses should implement this.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeMismatch, matchespublic FeatureMatcher(Matcher<? super U> subMatcher, java.lang.String featureDescription, java.lang.String featureName)
subMatcher - The matcher to apply to the featurefeatureDescription - Descriptive text to use in describeTofeatureName - Identifying text for mismatch messageprotected abstract U featureValueOf(T actual)
actual - the target objectprotected boolean matchesSafely(T actual, Description mismatch)
TypeSafeDiagnosingMatchermatchesSafely in class TypeSafeDiagnosingMatcher<T>public final void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.