Annotation Type Argument
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public @interface Argument
Parameters that are annotated with this annotation will be assigned the value of the parameter of the source method with the given parameter. For example, if source methodfoo(String, Integer)
is bound to target methodbar(@Argument(1) Integer)
, the second parameter offoo
will be bound to the first argument ofbar
.value()
, the method carrying this parameter annotation is excluded from the list of possible binding candidates to this particular source method. The same happens, if the source method parameter at the specified index is not assignable to the annotated parameter.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description int
value
The index of the parameter of the source method that should be bound to this parameter.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Argument.BindingMechanic
bindingMechanic
Determines if the argument binding is to be considered by aArgumentTypeResolver
for resolving ambiguous bindings of two methods.
-
-
-
-
bindingMechanic
Argument.BindingMechanic bindingMechanic
Determines if the argument binding is to be considered by aArgumentTypeResolver
for resolving ambiguous bindings of two methods. IfArgument.BindingMechanic.UNIQUE
, of two bindable target methods such as for examplefoo(String)
andbar(Object)
, thefoo
method would be considered as dominant over thebar
method because of its more specific argument type. As a side effect, only one parameter of any target method can be bound to a source method parameter with a given index unless theArgument.BindingMechanic.ANONYMOUS
option is used for any other binding.- Returns:
- The binding type that should be applied to this parameter binding.
- See Also:
ArgumentTypeResolver
- Default:
- net.bytebuddy.implementation.bind.annotation.Argument.BindingMechanic.UNIQUE
-
-