templates.method.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of feature-matcher-generator Show documentation
Show all versions of feature-matcher-generator Show documentation
Annotation Processor to generate Hamcrest's Feature Matchers for fields
/**
* Matcher for {@link ${type.qualifiedName()}#${field.name()}}
*/
@org.hamcrest.Factory
public static org.hamcrest.Matcher<${type.qualifiedName()}> with${utils.normalize(${field.name()})}(org.hamcrest.Matcher<${field.type()}> matcher) {
return new org.hamcrest.FeatureMatcher<${type.qualifiedName()}, ${field.type()}>(matcher, "${field.name()}", "${field.name()}") {
@Override
protected ${field.type()} featureValueOf(${type.qualifiedName()} actual) {
return actual.get${utils.normalize(${field.name()})}();
}
};
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy