程序包 org.hamcrest
类 FeatureMatcher<T,U>
- 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 matched
- 所有已实现的接口:
Matcher<T>
,SelfDescribing
public abstract class FeatureMatcher<T,U> extends TypeSafeDiagnosingMatcher<T>
Supporting class for matching a feature of an object. ImplementfeatureValueOf()
in a subclass to pull out the feature to be matched against.
构造器概要
构造器 构造器 说明 FeatureMatcher(Matcher<? super U> subMatcher, String featureDescription, String featureName)
Constructor
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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.从类继承的方法 org.hamcrest.TypeSafeDiagnosingMatcher
describeMismatch, matches
从类继承的方法 org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
构造器详细资料
FeatureMatcher
public FeatureMatcher(Matcher<? super U> subMatcher, String featureDescription, String featureName)
Constructor- 参数:
subMatcher
- The matcher to apply to the featurefeatureDescription
- Descriptive text to use in describeTofeatureName
- Identifying text for mismatch message
方法详细资料
featureValueOf
protected abstract U featureValueOf(T actual)
Implement this to extract the interesting feature.- 参数:
actual
- the target object- 返回:
- the feature to be matched
matchesSafely
protected boolean matchesSafely(T actual, Description mismatch)
从类复制的说明:TypeSafeDiagnosingMatcher
Subclasses should implement this. The item will already have been checked for the specific type and will never be null.- 指定者:
matchesSafely
在类中TypeSafeDiagnosingMatcher<T>
describeTo
public final void describeTo(Description description)
从接口复制的说明:SelfDescribing
Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.- 参数:
description
- The description to be built or appended to.