Enum MethodNameEqualityResolver
- java.lang.Object
-
- java.lang.Enum<MethodNameEqualityResolver>
-
- net.bytebuddy.implementation.bind.MethodNameEqualityResolver
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<MethodNameEqualityResolver>,MethodDelegationBinder.AmbiguityResolver
public enum MethodNameEqualityResolver extends java.lang.Enum<MethodNameEqualityResolver> implements MethodDelegationBinder.AmbiguityResolver
Implementation of anMethodDelegationBinder.AmbiguityResolverthat resolves conflicting bindings by considering equality of a target method's internalName as an indicator for a dominant binding.
For example, if methodsource.foocan be bound to methodstargetA.fooandtargetB.bar,targetA.foowill be considered as dominant.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver
MethodDelegationBinder.AmbiguityResolver.Compound, MethodDelegationBinder.AmbiguityResolver.Directional, MethodDelegationBinder.AmbiguityResolver.NoOp, MethodDelegationBinder.AmbiguityResolver.Resolution
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCEThe singleton instance.
-
Field Summary
-
Fields inherited from interface net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver
DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodNameEqualityResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDelegationBinder.AmbiguityResolver.Resolutionresolve(MethodDescription source, MethodDelegationBinder.MethodBinding left, MethodDelegationBinder.MethodBinding right)Attempts to resolve to conflicting bindings.static MethodNameEqualityResolvervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MethodNameEqualityResolver[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final MethodNameEqualityResolver INSTANCE
The singleton instance.
-
-
Method Detail
-
values
public static MethodNameEqualityResolver[] 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 (MethodNameEqualityResolver c : MethodNameEqualityResolver.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MethodNameEqualityResolver 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
-
resolve
public MethodDelegationBinder.AmbiguityResolver.Resolution resolve(MethodDescription source, MethodDelegationBinder.MethodBinding left, MethodDelegationBinder.MethodBinding right)
Attempts to resolve to conflicting bindings.- Specified by:
resolvein interfaceMethodDelegationBinder.AmbiguityResolver- Parameters:
source- The source method that was bound to both target methods.left- The first successful binding of thesourcemethod.right- The second successful binding of thesourcemethod.- Returns:
- The resolution state when resolving a conflicting binding where
MethodDelegationBinder.AmbiguityResolver.Resolution.LEFTindicates a successful binding to theleftbinding whileMethodDelegationBinder.AmbiguityResolver.Resolution.RIGHTindicates a successful binding to therightbinding.
-
-