@HashCodeAndEqualsPlugin.Enhance public static class MemberSubstitution.Replacement.ForElementMatchers extends java.lang.Object implements MemberSubstitution.Replacement
Modifier and Type | Class and Description |
---|---|
protected static class |
MemberSubstitution.Replacement.ForElementMatchers.Factory
A factory for creating a replacement that chooses members based on a row of element matchers.
|
MemberSubstitution.Replacement.Binding, MemberSubstitution.Replacement.ForElementMatchers, MemberSubstitution.Replacement.ForFirstBinding, MemberSubstitution.Replacement.InvocationType, MemberSubstitution.Replacement.NoOp
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 |
substitution
The substitution to trigger if a member is matched.
|
Modifier | Constructor and Description |
---|---|
protected |
ForElementMatchers(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher,
ElementMatcher<? super MethodDescription> methodMatcher,
boolean matchFieldRead,
boolean matchFieldWrite,
boolean includeVirtualCalls,
boolean includeSuperCalls,
MemberSubstitution.Substitution substitution)
Creates a new replacement that triggers a substitution based on a row of matchers.
|
Modifier and Type | Method and Description |
---|---|
MemberSubstitution.Replacement.Binding |
bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
FieldDescription.InDefinedShape fieldDescription,
boolean writeAccess)
Binds this replacement for a field that was discovered.
|
MemberSubstitution.Replacement.Binding |
bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
TypeDescription typeDescription,
MethodDescription methodDescription,
MemberSubstitution.Replacement.InvocationType invocationType)
Binds this replacement for a field that was discovered.
|
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 substitution
protected ForElementMatchers(ElementMatcher<? super FieldDescription.InDefinedShape> fieldMatcher, ElementMatcher<? super MethodDescription> methodMatcher, boolean matchFieldRead, boolean matchFieldWrite, boolean includeVirtualCalls, boolean includeSuperCalls, MemberSubstitution.Substitution substitution)
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.substitution
- The substitution to trigger if a member is matched.public MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, FieldDescription.InDefinedShape fieldDescription, boolean writeAccess)
bind
in interface MemberSubstitution.Replacement
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.fieldDescription
- The field that was discovered.writeAccess
- true
if this field was written to.public MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, MethodDescription methodDescription, MemberSubstitution.Replacement.InvocationType invocationType)
bind
in interface MemberSubstitution.Replacement
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typeDescription
- The type on which the method was invoked.methodDescription
- The method that was discovered.invocationType
- The invocation type for this method.