|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hamcrest.BaseMatcher<T> org.hamcrest.TypeSafeDiagnosingMatcher<T> org.hamcrest.FeatureMatcher<T,U>
T
- The type of the object to be matchedU
- The type of the feature to be matchedpublic abstract class FeatureMatcher<T,U>
Supporting class for matching a feature of an object. Implement featureValueOf()
in a subclass to pull out the feature to be matched against.
Constructor Summary | |
---|---|
FeatureMatcher(Matcher<? super U> subMatcher,
String featureDescription,
String featureName)
Constructor |
Method Summary | |
---|---|
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. |
Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher |
---|
describeMismatch, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FeatureMatcher(Matcher<? super U> subMatcher, String featureDescription, String featureName)
subMatcher
- The matcher to apply to the featurefeatureDescription
- Descriptive text to use in describeTofeatureName
- Identifying text for mismatch messageMethod Detail |
---|
protected abstract U featureValueOf(T actual)
actual
- the target object
protected boolean matchesSafely(T actual, Description mismatch)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<T>
public final void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |