net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver
that resolves two conflicting bindings by considering most-specific types of target method parameters in the same manner
as the Java compiler resolves bindings of overloaded method.
This ambiguity resolver:
For example: If a source method only parameter was successfully bound one-to-one to the only parameters of the target methods
foo(Object) and bar(String), this ambiguity resolver will detect that the String type
is more specific than the Object type and determine bar(String) as the dominant binding.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ArgumentTypeResolver.ParameterIndexToken
This token is used to mark a one-to-one binding of a source method parameter to a target method parameter. |
| protected static enum | ArgumentTypeResolver.PrimitiveTypePrecedence
A representation of the precedence of a most specific primitive type in the Java programming language. |
| Modifier and Type | Field and Description |
|---|---|
| public static final ArgumentTypeResolver | INSTANCE
The singleton instance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MethodDelegationBinder. | resolve(MethodDescription
The source method that was bound to both target methods. source, MethodDelegationBinder.The first successful binding of the left,source method.The second successful binding of the rightsource method.Implements net. |
| private static MethodDelegationBinder. | Returns: A resolution according to this score.The difference of the scores of the left and the right method. boundParameterScore)Resolves the most specific method by their score. |
| private static MethodDelegationBinder. | Returns: A resolution according to the given parameters.The parameter type of the source method sourceParameterType, int The index of the parameter of the left method. leftParameterIndex, MethodDelegationBinder.The left method's parameter binding. left,The index of the parameter of the right method. rightParameterIndex, MethodDelegationBinder.The right method's parameter binding. rightResolves two bindings by comparing their binding of similar arguments and determining their most specific types. |
| public static ArgumentTypeResolver | |
| public static ArgumentTypeResolver[] |
| INSTANCE | back to summary |
|---|---|
| public static final ArgumentTypeResolver INSTANCE The singleton instance. | |
| ArgumentTypeResolver | back to summary |
|---|---|
| private ArgumentTypeResolver() | |
| resolveByScore | back to summary |
|---|---|
| private static MethodDelegationBinder. Resolves the most specific method by their score. A method's score is calculated by the absolute number of
parameters that were bound by using an explicit
| |
| resolveRivalBinding | back to summary |
|---|---|
| private static MethodDelegationBinder. Resolves two bindings by comparing their binding of similar arguments and determining their most specific types.
| |
| valueOf | back to summary |
|---|---|
| public static ArgumentTypeResolver valueOf(String name) | |
| values | back to summary |
|---|---|
| public static ArgumentTypeResolver[] values() | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | parameterIndex
The parameter index that is represented by this token. |
| Access | Constructor and Description |
|---|---|
| public | ParameterIndexToken(int
The parameter index of the source method which is mapped to a target method parameter. parameterIndex)Create a parameter index token for a given parameter of the source method. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public int |
| parameterIndex | back to summary |
|---|---|
| private final int parameterIndex The parameter index that is represented by this token.
| |
| ParameterIndexToken | back to summary |
|---|---|
| public ParameterIndexToken(int parameterIndex) Create a parameter index token for a given parameter of the source method.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final ArgumentTypeResolver. | BOOLEAN
The precedence of the |
| public static final ArgumentTypeResolver. | BYTE
The precedence of the |
| public static final ArgumentTypeResolver. | CHARACTER
The precedence of the |
| public static final ArgumentTypeResolver. | DOUBLE
The precedence of the |
| public static final ArgumentTypeResolver. | FLOAT
The precedence of the |
| public static final ArgumentTypeResolver. | INTEGER
The precedence of the |
| public static final ArgumentTypeResolver. | LONG
The precedence of the |
| private final int | score
A score representing the precedence where a higher score represents a less specific type. |
| public static final ArgumentTypeResolver. | SHORT
The precedence of the |
| Access | Constructor and Description |
|---|---|
| private | PrimitiveTypePrecedence(int
A score representing the precedence where a higher score represents a less specific type. score)Creates a new primitive type precedence. |
| Modifier and Type | Method and Description |
|---|---|
| public static ArgumentTypeResolver. | Returns: The corresponding primitive type precedence.The non-void, primitive type for which the precedence should be located. typeDescription)Locates the primitive type precedence for a given type. |
| public MethodDelegationBinder. | Returns: The resolution ofAnother primitive type precedence against which this precedence should be resolved. rightResolves the least specific type of two primitive type precedence with this instance representing a
|
| public static ArgumentTypeResolver. | |
| public static ArgumentTypeResolver. |
| BOOLEAN | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| BYTE | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| CHARACTER | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| DOUBLE | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| FLOAT | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| INTEGER | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| LONG | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| score | back to summary |
|---|---|
| private final int score A score representing the precedence where a higher score represents a less specific type. | |
| SHORT | back to summary |
|---|---|
| public static final ArgumentTypeResolver. The precedence of the | |
| PrimitiveTypePrecedence | back to summary |
|---|---|
| private PrimitiveTypePrecedence(int score) Creates a new primitive type precedence.
| |
| forPrimitive | back to summary |
|---|---|
| public static ArgumentTypeResolver. Locates the primitive type precedence for a given type.
| |
| resolve | back to summary |
|---|---|
| public MethodDelegationBinder. Resolves the least specific type of two primitive type precedence with this instance representing a
| |
| valueOf | back to summary |
|---|---|
| public static ArgumentTypeResolver. | |
| values | back to summary |
|---|---|
| public static ArgumentTypeResolver. | |