Enum Class ArgumentTypeResolver

java.lang.Object
java.lang.Enum<ArgumentTypeResolver>
net.bytebuddy.implementation.bind.ArgumentTypeResolver
All Implemented Interfaces:
Serializable, Comparable<ArgumentTypeResolver>, Constable, MethodDelegationBinder.AmbiguityResolver

public enum ArgumentTypeResolver extends Enum<ArgumentTypeResolver> implements MethodDelegationBinder.AmbiguityResolver
Implementation of an 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:
  1. Checks for each parameter of the source method if a one-to-one parameter binding to both of the target methods exist.
  2. If any of the source method parameters were bound one-to-one to both target methods, the method with the most specific type is considered as dominant.
  3. If this result is dominant for both the left and the right target method, this resolver will consider the binding as ambiguous.
  4. If none of the methods is dominant and if the comparison did not result in an ambiguous resolution, the method that consists of the most one-to-one parameter bindings is considered dominant.
Primitive types are considered dominant in the same manner as by the Java compiler.

 

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.