Package net.bytebuddy.asm
Class MemberSubstitution.Replacement.ForFirstBinding
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Replacement.ForFirstBinding
- All Implemented Interfaces:
MemberSubstitution.Replacement
- Enclosing interface:
MemberSubstitution.Replacement
@Enhance
public static class MemberSubstitution.Replacement.ForFirstBinding
extends Object
implements MemberSubstitution.Replacement
A replacement that only resolves the first matching replacement of a list of replacements.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Replacement
MemberSubstitution.Replacement.Binding, MemberSubstitution.Replacement.Factory, MemberSubstitution.Replacement.ForElementMatchers, MemberSubstitution.Replacement.ForFirstBinding, MemberSubstitution.Replacement.InvocationType, MemberSubstitution.Replacement.NoOp -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<? extends MemberSubstitution.Replacement> The list of replacements to consider. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForFirstBinding(List<? extends MemberSubstitution.Replacement> replacements) Creates a new replacement that triggers the first matching replacement, if any. -
Method Summary
Modifier and TypeMethodDescriptionbind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, FieldDescription.InDefinedShape fieldDescription, boolean writeAccess) Binds this replacement for a field that was discovered.bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, MethodDescription methodDescription, MemberSubstitution.Replacement.InvocationType invocationType) Binds this replacement for a field that was discovered.
-
Field Details
-
replacements
The list of replacements to consider.
-
-
Constructor Details
-
ForFirstBinding
Creates a new replacement that triggers the first matching replacement, if any.- Parameters:
replacements- The list of replacements to consider.
-
-
Method Details
-
bind
public MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, FieldDescription.InDefinedShape fieldDescription, boolean writeAccess) Binds this replacement for a field that was discovered.- Specified by:
bindin interfaceMemberSubstitution.Replacement- Parameters:
instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.fieldDescription- The field that was discovered.writeAccess-trueif this field was written to.- Returns:
- A binding for the discovered field access.
-
bind
public 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.- Specified by:
bindin interfaceMemberSubstitution.Replacement- Parameters:
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.- Returns:
- A binding for the discovered method invocation.
-