public class FeatureMatchers extends Object
FeatureMatcherclasses. This uses an accessor to simplify construction. In most cases, the accessor may be expressed as method reference, which greatly simplifies the code.
|Constructor and Description|
|Modifier and Type||Method and Description|
Builds a feature matcher using an accessor method to get the feature.
public static <X,Y> org.hamcrest.FeatureMatcher<X,Y> hasFeature(java.util.function.Function<X,Y> featureAccessor, org.hamcrest.Matcher<Y> innerMatcher, String featureDescription, String featureName)
Method name is tailored to static importing.
X- type to by matched by this matcher
Y- type of the feature to be accessed
featureAccessor- a function, that returns the instance of the feature from the matched object
innerMatcher- a matcher for the feature instance
featureDescription- Descriptive text to use in describeTo
featureName- Identifying text for mismatch message
Copyright © 2002-2016 Atlassian. All Rights Reserved.