Class Advice.Dispatcher.RelocationHandler.ForType
java.lang.Object
net.bytebuddy.asm.Advice.Dispatcher.RelocationHandler.ForType
- All Implemented Interfaces:
Advice.Dispatcher.RelocationHandler
- Enclosing interface:
Advice.Dispatcher.RelocationHandler
@Enhance
public static class Advice.Dispatcher.RelocationHandler.ForType
extends Object
implements Advice.Dispatcher.RelocationHandler
A relocation handler that is triggered if the checked value is an instance of a given type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA bound relocation handler forAdvice.Dispatcher.RelocationHandler.ForType.Nested classes/interfaces inherited from interface Advice.Dispatcher.RelocationHandler
Advice.Dispatcher.RelocationHandler.Disabled, Advice.Dispatcher.RelocationHandler.ForType, Advice.Dispatcher.RelocationHandler.ForValue, Advice.Dispatcher.RelocationHandler.Relocation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe index of the array returned by the advice method that contains the value to check for its type.private final TypeDescriptionThe type that triggers a relocation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForType(TypeDescription typeDescription, int index) Creates a new relocation handler that triggers a relocation if a value is an instance of a given type. -
Method Summary
Modifier and TypeMethodDescriptionbind(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation) Binds this relocation handler to a relocation dispatcher.protected static Advice.Dispatcher.RelocationHandlerof(TypeDescription typeDescription, int index, TypeDefinition returnedType) Resolves a relocation handler that is triggered if the checked instance is of a given type.
-
Field Details
-
typeDescription
The type that triggers a relocation. -
index
private final int indexThe index of the array returned by the advice method that contains the value to check for its type.
-
-
Constructor Details
-
ForType
Creates a new relocation handler that triggers a relocation if a value is an instance of a given type.- Parameters:
typeDescription- The type that triggers a relocation.index- The index of the array returned by the advice method that contains the value to check for its type.
-
-
Method Details
-
of
protected static Advice.Dispatcher.RelocationHandler of(TypeDescription typeDescription, int index, TypeDefinition returnedType) Resolves a relocation handler that is triggered if the checked instance is of a given type.- Parameters:
typeDescription- The type that triggers a relocation.index- The array index of the value that is returned.returnedType- The type that is returned by the advice method.- Returns:
- An appropriate relocation handler.
-
bind
public Advice.Dispatcher.RelocationHandler.Bound bind(MethodDescription instrumentedMethod, Advice.Dispatcher.RelocationHandler.Relocation relocation) Binds this relocation handler to a relocation dispatcher.- Specified by:
bindin interfaceAdvice.Dispatcher.RelocationHandler- Parameters:
instrumentedMethod- The instrumented method.relocation- The relocation to apply.- Returns:
- A bound relocation handler.
-