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 java.lang.Object implements MethodDelegationBinder.ParameterBinding<T>
A uniquely identifiable parameter binding for a target method. Such bindings are usually later processed by aMethodDelegationBinder.AmbiguityResolver
in order to resolve binding conflicts between several bindable target methods to the same source method.- See Also:
MethodDelegationBinder.AmbiguityResolver
-
-
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.Compound, StackManipulation.Size, StackManipulation.Trivial
-
-
Field Summary
Fields Modifier and Type Field Description private StackManipulation
delegate
The stack manipulation that represents the loading of the parameter binding onto the stack.private T
identificationToken
The token that identifies this parameter binding as unique.
-
Constructor Summary
Constructors Constructor Description Unique(StackManipulation delegate, T identificationToken)
Creates a new unique parameter binding representant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation.Size
apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.T
getIdentificationToken()
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 Detail
-
identificationToken
private final T identificationToken
The token that identifies this parameter binding as unique.
-
delegate
private final StackManipulation delegate
The stack manipulation that represents the loading of the parameter binding onto the stack.
-
-
Constructor Detail
-
Unique
public Unique(StackManipulation delegate, T identificationToken)
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 Detail
-
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
public T 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.
-
-