public class FeatureMatchers extends Object
FeatureMatcher
classes. 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 |
---|
FeatureMatchers() |
Modifier and Type | Method and Description |
---|---|
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)
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 matcherY
- type of the feature to be accessedfeatureAccessor
- a function, that returns the instance of the feature
from the matched objectinnerMatcher
- a matcher for the feature instancefeatureDescription
- Descriptive text to use in describeTofeatureName
- Identifying text for mismatch messageFeatureMatcher
Copyright © 2002-2022 Atlassian. All Rights Reserved.