Class MethodDelegationBinder.MethodBinding.Builder
- java.lang.Object
-
- net.bytebuddy.implementation.bind.MethodDelegationBinder.MethodBinding.Builder
-
- Enclosing interface:
- MethodDelegationBinder.MethodBinding
public static class MethodDelegationBinder.MethodBinding.Builder extends java.lang.Object
A mutable builder that allows to compose aMethodDelegationBinder.MethodBinding
by adding parameter bindings incrementally.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MethodDelegationBinder.MethodBinding.Builder.Build
A method binding that was created by aMethodDelegationBinder.MethodBinding.Builder
.
-
Constructor Summary
Constructors Constructor Description Builder(MethodDelegationBinder.MethodInvoker methodInvoker, MethodDescription candidate)
Creates a new builder for the binding of a given method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
append(MethodDelegationBinder.ParameterBinding<?> parameterBinding)
Appends a stack manipulation for the next parameter of the target method.MethodDelegationBinder.MethodBinding
build(StackManipulation terminatingManipulation)
Creates a binding that represents the bindings collected by thisBuilder
.
-
-
-
Constructor Detail
-
Builder
public Builder(MethodDelegationBinder.MethodInvoker methodInvoker, MethodDescription candidate)
Creates a new builder for the binding of a given method.- Parameters:
methodInvoker
- The method invoker that is used to create the method invocation of thetarget
method.candidate
- The target method that is target of the binding.
-
-
Method Detail
-
append
public boolean append(MethodDelegationBinder.ParameterBinding<?> parameterBinding)
Appends a stack manipulation for the next parameter of the target method.- Parameters:
parameterBinding
- A binding representing the next subsequent parameter of the method.- Returns:
false
if theparameterBindingToken
was already bound. A conflicting binding should usually abort the attempt of binding a method and thisBuilder
should be discarded.
-
build
public MethodDelegationBinder.MethodBinding build(StackManipulation terminatingManipulation)
Creates a binding that represents the bindings collected by thisBuilder
.- Parameters:
terminatingManipulation
- A stack manipulation that is applied after the method invocation.- Returns:
- A binding representing the parameter bindings collected by this builder.
-
-