Class MethodDelegationBinder.ParameterBinding.Unique<T>
java.lang.Object
net.bytebuddy.implementation.bind.MethodDelegationBinder.ParameterBinding.Unique<T>
- Type Parameters:
T
- The type of the identification token.
- All Implemented Interfaces:
MethodDelegationBinder.ParameterBinding<T>
,StackManipulation
- Enclosing interface:
MethodDelegationBinder.ParameterBinding<T>
@Enhance
public static class MethodDelegationBinder.ParameterBinding.Unique<T>
extends Object
implements MethodDelegationBinder.ParameterBinding<T>
A uniquely identifiable parameter binding for a target method. Such bindings are usually later processed by
a
MethodDelegationBinder.AmbiguityResolver
in order to resolve binding conflicts between several bindable target methods to the same source method.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.MethodDelegationBinder.ParameterBinding
MethodDelegationBinder.ParameterBinding.Anonymous, MethodDelegationBinder.ParameterBinding.Illegal, MethodDelegationBinder.ParameterBinding.Unique<T>
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.StackManipulation
StackManipulation.AbstractBase, StackManipulation.Compound, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulation
The stack manipulation that represents the loading of the parameter binding onto the stack.private final T
The token that identifies this parameter binding as unique. -
Constructor Summary
ConstructorsConstructorDescriptionUnique
(StackManipulation delegate, T identificationToken) Creates a new unique parameter binding representant. -
Method Summary
Modifier and TypeMethodDescriptionapply
(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the stack manipulation that is described by this instance.Returns an identification token for this binding.boolean
isValid()
Determines if this stack manipulation is valid.static <S> MethodDelegationBinder.ParameterBinding.Unique
<S> of
(StackManipulation delegate, S identificationToken) A factory method for creating a unique binding that infers the tokens type.
-
Field Details
-
identificationToken
The token that identifies this parameter binding as unique. -
delegate
The stack manipulation that represents the loading of the parameter binding onto the stack.
-
-
Constructor Details
-
Unique
Creates a new unique parameter binding representant.- Parameters:
delegate
- The stack manipulation that loads the argument for this parameter onto the operand stack.identificationToken
- The token used for identifying this parameter binding.
-
-
Method Details
-
of
public static <S> MethodDelegationBinder.ParameterBinding.Unique<S> of(StackManipulation delegate, S identificationToken) A factory method for creating a unique binding that infers the tokens type.- Type Parameters:
S
- The type of the identification token.- Parameters:
delegate
- The stack manipulation delegate.identificationToken
- The identification token.- Returns:
- A new instance representing this unique binding.
-
getIdentificationToken
Returns an identification token for this binding.- Specified by:
getIdentificationToken
in interfaceMethodDelegationBinder.ParameterBinding<T>
- Returns:
- An identification token unique to this binding.
-
isValid
public boolean isValid()Determines if this stack manipulation is valid.- Specified by:
isValid
in interfaceStackManipulation
- Returns:
- If
false
, this manipulation cannot be applied and should throw an exception.
-
apply
public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext) Applies the stack manipulation that is described by this instance.- Specified by:
apply
in interfaceStackManipulation
- Parameters:
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.- Returns:
- The changes to the size of the operand stack that are implied by this stack manipulation.
-