Enum ArgumentTypeResolver.PrimitiveTypePrecedence
- java.lang.Object
-
- java.lang.Enum<ArgumentTypeResolver.PrimitiveTypePrecedence>
-
- net.bytebuddy.implementation.bind.ArgumentTypeResolver.PrimitiveTypePrecedence
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ArgumentTypeResolver.PrimitiveTypePrecedence>
- Enclosing class:
- ArgumentTypeResolver
protected static enum ArgumentTypeResolver.PrimitiveTypePrecedence extends java.lang.Enum<ArgumentTypeResolver.PrimitiveTypePrecedence>
A representation of the precedence of a most specific primitive type in the Java programming language.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
The precedence of theboolean
type.BYTE
The precedence of thebyte
type.CHARACTER
The precedence of thechar
type.DOUBLE
The precedence of thedouble
type.FLOAT
The precedence of thefloat
type.INTEGER
The precedence of theint
type.LONG
The precedence of thelong
type.SHORT
The precedence of theshort
type.
-
Field Summary
Fields Modifier and Type Field Description private int
score
A score representing the precedence where a higher score represents a less specific type.
-
Constructor Summary
Constructors Modifier Constructor Description private
PrimitiveTypePrecedence(int score)
Creates a new primitive type precedence.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ArgumentTypeResolver.PrimitiveTypePrecedence
forPrimitive(TypeDescription typeDescription)
Locates the primitive type precedence for a given type.MethodDelegationBinder.AmbiguityResolver.Resolution
resolve(ArgumentTypeResolver.PrimitiveTypePrecedence right)
Resolves the least specific type of two primitive type precedence with this instance representing aMethodDelegationBinder.AmbiguityResolver.Resolution.LEFT
resolution and the argument type representing theMethodDelegationBinder.AmbiguityResolver.Resolution.RIGHT
resolution.static ArgumentTypeResolver.PrimitiveTypePrecedence
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ArgumentTypeResolver.PrimitiveTypePrecedence[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final ArgumentTypeResolver.PrimitiveTypePrecedence BOOLEAN
The precedence of theboolean
type.
-
BYTE
public static final ArgumentTypeResolver.PrimitiveTypePrecedence BYTE
The precedence of thebyte
type.
-
SHORT
public static final ArgumentTypeResolver.PrimitiveTypePrecedence SHORT
The precedence of theshort
type.
-
INTEGER
public static final ArgumentTypeResolver.PrimitiveTypePrecedence INTEGER
The precedence of theint
type.
-
CHARACTER
public static final ArgumentTypeResolver.PrimitiveTypePrecedence CHARACTER
The precedence of thechar
type.
-
LONG
public static final ArgumentTypeResolver.PrimitiveTypePrecedence LONG
The precedence of thelong
type.
-
FLOAT
public static final ArgumentTypeResolver.PrimitiveTypePrecedence FLOAT
The precedence of thefloat
type.
-
DOUBLE
public static final ArgumentTypeResolver.PrimitiveTypePrecedence DOUBLE
The precedence of thedouble
type.
-
-
Method Detail
-
values
public static ArgumentTypeResolver.PrimitiveTypePrecedence[] 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 (ArgumentTypeResolver.PrimitiveTypePrecedence c : ArgumentTypeResolver.PrimitiveTypePrecedence.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArgumentTypeResolver.PrimitiveTypePrecedence 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
-
forPrimitive
public static ArgumentTypeResolver.PrimitiveTypePrecedence forPrimitive(TypeDescription typeDescription)
Locates the primitive type precedence for a given type.- Parameters:
typeDescription
- The non-void, primitive type for which the precedence should be located.- Returns:
- The corresponding primitive type precedence.
-
resolve
public MethodDelegationBinder.AmbiguityResolver.Resolution resolve(ArgumentTypeResolver.PrimitiveTypePrecedence right)
Resolves the least specific type of two primitive type precedence with this instance representing aMethodDelegationBinder.AmbiguityResolver.Resolution.LEFT
resolution and the argument type representing theMethodDelegationBinder.AmbiguityResolver.Resolution.RIGHT
resolution.- Parameters:
right
- Another primitive type precedence against which this precedence should be resolved.- Returns:
- The resolution of
-
-