@HashCodeAndEqualsPlugin.Enhance protected static class MethodDelegationBinder.MethodBinding.Builder.Build extends Object implements MethodDelegationBinder.MethodBinding
MethodDelegationBinder.MethodBinding.Builder
.MethodDelegationBinder.MethodBinding.Builder, MethodDelegationBinder.MethodBinding.Illegal
StackManipulation.AbstractBase, StackManipulation.Compound, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial
Modifier | Constructor and Description |
---|---|
protected |
Build(MethodDescription target,
Map<?,Integer> registeredTargetIndices,
StackManipulation methodInvocation,
List<StackManipulation> parameterStackManipulations,
StackManipulation terminatingStackManipulation)
Creates a new method binding.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation.Size |
apply(MethodVisitor methodVisitor,
Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.
|
MethodDescription |
getTarget()
Returns the target method of the method binding attempt.
|
Integer |
getTargetParameterIndex(Object parameterBindingToken)
Returns the target method's parameter index for a given parameter binding token.
|
boolean |
isValid()
Determines if this stack manipulation is valid.
|
protected Build(MethodDescription target, Map<?,Integer> registeredTargetIndices, StackManipulation methodInvocation, List<StackManipulation> parameterStackManipulations, StackManipulation terminatingStackManipulation)
target
- The target method this binding represents.registeredTargetIndices
- A map of identification tokens to the indices of their binding
parameters.methodInvocation
- A stack manipulation that represents the actual method invocation.parameterStackManipulations
- A list of manipulations that each represent the loading of a
parameter value onto the operand stack.terminatingStackManipulation
- The stack manipulation that is applied after the method invocation.public boolean isValid()
isValid
in interface StackManipulation
false
, this manipulation cannot be applied and should throw an exception.@MaybeNull public Integer getTargetParameterIndex(Object parameterBindingToken)
A binding token can be any object that implements valid
Object.hashCode()
and Object.equals(Object)
methods in order
to look up a given binding. This way, two bindings can be evaluated of having performed a similar type of
binding such that these bindings can be compared and a dominant binding can be identified by an
MethodDelegationBinder.AmbiguityResolver
.
Furthermore, a binding is implicitly required to insure the uniqueness of such a parameter binding.getTargetParameterIndex
in interface MethodDelegationBinder.MethodBinding
parameterBindingToken
- A token which is used to identify a specific unique binding for a given parameter
of the target method.null
if no such argument binding
was applied for this binding.public MethodDescription getTarget()
getTarget
in interface MethodDelegationBinder.MethodBinding
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)
apply
in interface StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.Copyright © 2014–2025. All rights reserved.