Enum Argument.BindingMechanic
- java.lang.Object
-
- java.lang.Enum<Argument.BindingMechanic>
-
- net.bytebuddy.implementation.bind.annotation.Argument.BindingMechanic
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Argument.BindingMechanic>
- Enclosing class:
- Argument
public static enum Argument.BindingMechanic extends java.lang.Enum<Argument.BindingMechanic>
Determines if a parameter binding should be considered for resolving ambiguous method bindings.- See Also:
Argument.bindingMechanic()
,ArgumentTypeResolver
-
-
Constructor Summary
Constructors Modifier Constructor Description private
BindingMechanic()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MethodDelegationBinder.ParameterBinding<?>
makeBinding(TypeDescription.Generic source, TypeDescription.Generic target, int sourceParameterIndex, Assigner assigner, Assigner.Typing typing, int parameterOffset)
Creates a binding that corresponds to this binding mechanic.static Argument.BindingMechanic
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Argument.BindingMechanic[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNIQUE
public static final Argument.BindingMechanic UNIQUE
The binding is unique, i.e. only one such binding must be present among all parameters of a method. As a consequence, the binding can be latter identified by anMethodDelegationBinder.AmbiguityResolver
.
-
ANONYMOUS
public static final Argument.BindingMechanic ANONYMOUS
The binding is anonymous, i.e. it can be present on several parameters of the same method.
-
-
Method Detail
-
values
public static Argument.BindingMechanic[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Argument.BindingMechanic c : Argument.BindingMechanic.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Argument.BindingMechanic valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
makeBinding
protected abstract MethodDelegationBinder.ParameterBinding<?> makeBinding(TypeDescription.Generic source, TypeDescription.Generic target, int sourceParameterIndex, Assigner assigner, Assigner.Typing typing, int parameterOffset)
Creates a binding that corresponds to this binding mechanic.- Parameters:
source
- The source type to be bound.target
- The target type thesourceType
is to be bound to.sourceParameterIndex
- The index of the source parameter.assigner
- The assigner that is used to perform the assignment.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.parameterOffset
- The offset of the source method's parameter.- Returns:
- A binding considering the chosen binding mechanic.
-
-