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>
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.AmbiguityResolverin 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
-
-
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.Sizeapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)Applies the stack manipulation that is described by this instance.TgetIdentificationToken()Returns an identification token for this binding.booleanisValid()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.
-
-
-
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()
Description copied from interface:MethodDelegationBinder.ParameterBindingReturns an identification token for this binding.- Specified by:
getIdentificationTokenin interfaceMethodDelegationBinder.ParameterBinding<T>- Returns:
- An identification token unique to this binding.
-
isValid
public boolean isValid()
Description copied from interface:StackManipulationDetermines if this stack manipulation is valid.- Specified by:
isValidin 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)
Description copied from interface:StackManipulationApplies the stack manipulation that is described by this instance.- Specified by:
applyin 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.
-
-