@HashCodeAndEqualsPlugin.Enhance protected static class MemberSubstitution.Replacement.ForElementMatchers.Factory extends java.lang.Object implements MemberSubstitution.Replacement.Factory
MemberSubstitution.Replacement.Factory.Compound
Modifier and Type | Field and Description |
---|---|
private ElementMatcher<? super FieldDescription.InDefinedShape> |
fieldMatcher
The field matcher to consider when discovering fields.
|
private boolean |
includeSuperCalls
true if super method calls should be matched. |
private boolean |
includeVirtualCalls
true if virtual method calls should be matched. |
private boolean |
matchFieldRead
true if field reading access should be matched. |
private boolean |
matchFieldWrite
true if field writing access should be matched. |
private ElementMatcher<? super MethodDescription> |
methodMatcher
The method matcher to consider when discovering methods.
|
private MemberSubstitution.Substitution.Factory |
substitutionFactory
The substitution factory to create a substitution from.
|
Modifier | Constructor and Description |
---|---|
protected |
Factory(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher,
ElementMatcher<? super MethodDescription> methodMatcher,
boolean matchFieldRead,
boolean matchFieldWrite,
boolean includeVirtualCalls,
boolean includeSuperCalls,
MemberSubstitution.Substitution.Factory substitutionFactory)
Creates a new replacement that triggers a substitution based on a row of matchers.
|
Modifier and Type | Method and Description |
---|---|
MemberSubstitution.Replacement |
make(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
TypePool typePool)
Creates a replacement for an instrumented method.
|
protected static MemberSubstitution.Replacement.Factory |
of(ElementMatcher<? super ByteCodeElement> matcher,
MemberSubstitution.Substitution.Factory factory)
Creates a factory for applying a substitution on all matched byte code elements for all access types.
|
protected static MemberSubstitution.Replacement.Factory |
ofField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher,
boolean matchFieldRead,
boolean matchFieldWrite,
MemberSubstitution.Substitution.Factory factory)
Creates a factory that only matches field access for given access types.
|
protected static MemberSubstitution.Replacement.Factory |
ofMethod(ElementMatcher<? super MethodDescription> matcher,
boolean includeVirtualCalls,
boolean includeSuperCalls,
MemberSubstitution.Substitution.Factory factory)
Creates a factory that only matches method and constructor invocations for given invocation types.
|
private final ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher
private final ElementMatcher<? super MethodDescription> methodMatcher
private final boolean matchFieldRead
true
if field reading access should be matched.private final boolean matchFieldWrite
true
if field writing access should be matched.private final boolean includeVirtualCalls
true
if virtual method calls should be matched.private final boolean includeSuperCalls
true
if super method calls should be matched.private final MemberSubstitution.Substitution.Factory substitutionFactory
protected Factory(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher, ElementMatcher<? super MethodDescription> methodMatcher, boolean matchFieldRead, boolean matchFieldWrite, boolean includeVirtualCalls, boolean includeSuperCalls, MemberSubstitution.Substitution.Factory substitutionFactory)
fieldMatcher
- The field matcher to consider when discovering fields.methodMatcher
- The method matcher to consider when discovering methods.matchFieldRead
- true
if field reading access should be matched.matchFieldWrite
- true
if field writing access should be matched.includeVirtualCalls
- true
if virtual method calls should be matched.includeSuperCalls
- true
if super method calls should be matched.substitutionFactory
- The substitution factory to create a substitution from.protected static MemberSubstitution.Replacement.Factory of(ElementMatcher<? super ByteCodeElement> matcher, MemberSubstitution.Substitution.Factory factory)
matcher
- The matcher to apply.factory
- The substitution factory to create a substitution from.protected static MemberSubstitution.Replacement.Factory ofField(ElementMatcher<? super FieldDescription.InDefinedShape> matcher, boolean matchFieldRead, boolean matchFieldWrite, MemberSubstitution.Substitution.Factory factory)
matcher
- The matcher to identify fields for substitution.matchFieldRead
- true
if field read access should be matched.matchFieldWrite
- true
if field write access should be matched.factory
- The substitution factory to apply for fields that match the specified criteria.protected static MemberSubstitution.Replacement.Factory ofMethod(ElementMatcher<? super MethodDescription> matcher, boolean includeVirtualCalls, boolean includeSuperCalls, MemberSubstitution.Substitution.Factory factory)
matcher
- The matcher to identify methods and constructors for substitution.includeVirtualCalls
- true
if virtual method calls should be matched.includeSuperCalls
- true
if super method calls should be matched.factory
- The substitution factory to apply for methods and constructors that match the specified criteria.public MemberSubstitution.Replacement make(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool)
make
in interface MemberSubstitution.Replacement.Factory
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typePool
- The type pool being used within the member substitution being applied.