Enum PrimitiveBoxingDelegate
- java.lang.Object
-
- java.lang.Enum<PrimitiveBoxingDelegate>
-
- net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveBoxingDelegate
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PrimitiveBoxingDelegate>
public enum PrimitiveBoxingDelegate extends java.lang.Enum<PrimitiveBoxingDelegate>
This delegate is responsible for boxing a primitive types to their wrapper equivalents.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PrimitiveBoxingDelegate.BoxingStackManipulation
A stack manipulation for boxing a primitive type into its wrapper type.
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
The boxing delegate forboolean
values.BYTE
The boxing delegate forbyte
values.CHARACTER
The boxing delegate forchar
values.DOUBLE
The boxing delegate fordouble
values.FLOAT
The boxing delegate forfloat
values.INTEGER
The boxing delegate forint
values.LONG
The boxing delegate forlong
values.SHORT
The boxing delegate forshort
values.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
boxingMethodDescriptor
The descriptor of the method for boxing a primitive value as its wrapper type.private java.lang.String
boxingMethodName
The name of the method for boxing a primitive value as its wrapper type.private StackManipulation.Size
size
The size decrease after a primitive type was wrapped.private TypeDescription
wrapperType
A description of a wrapper type.
-
Constructor Summary
Constructors Modifier Constructor Description private
PrimitiveBoxingDelegate(java.lang.Class<?> wrapperType, StackSize sizeDifference, java.lang.String boxingMethodName, java.lang.String boxingMethodDescriptor)
Creates a new primitive boxing delegate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulation
assignBoxedTo(TypeDescription.Generic target, Assigner chainedAssigner, Assigner.Typing typing)
Creates a stack manipulation that boxes the represented primitive type and applies a chained assignment to the result of this boxing operation.static PrimitiveBoxingDelegate
forPrimitive(TypeDefinition typeDefinition)
Locates a boxing delegate for a given primitive type.static PrimitiveBoxingDelegate
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PrimitiveBoxingDelegate[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final PrimitiveBoxingDelegate BOOLEAN
The boxing delegate forboolean
values.
-
BYTE
public static final PrimitiveBoxingDelegate BYTE
The boxing delegate forbyte
values.
-
SHORT
public static final PrimitiveBoxingDelegate SHORT
The boxing delegate forshort
values.
-
CHARACTER
public static final PrimitiveBoxingDelegate CHARACTER
The boxing delegate forchar
values.
-
INTEGER
public static final PrimitiveBoxingDelegate INTEGER
The boxing delegate forint
values.
-
LONG
public static final PrimitiveBoxingDelegate LONG
The boxing delegate forlong
values.
-
FLOAT
public static final PrimitiveBoxingDelegate FLOAT
The boxing delegate forfloat
values.
-
DOUBLE
public static final PrimitiveBoxingDelegate DOUBLE
The boxing delegate fordouble
values.
-
-
Field Detail
-
wrapperType
private final TypeDescription wrapperType
A description of a wrapper type.
-
size
private final StackManipulation.Size size
The size decrease after a primitive type was wrapped.
-
boxingMethodName
private final java.lang.String boxingMethodName
The name of the method for boxing a primitive value as its wrapper type.
-
boxingMethodDescriptor
private final java.lang.String boxingMethodDescriptor
The descriptor of the method for boxing a primitive value as its wrapper type.
-
-
Constructor Detail
-
PrimitiveBoxingDelegate
private PrimitiveBoxingDelegate(java.lang.Class<?> wrapperType, StackSize sizeDifference, java.lang.String boxingMethodName, java.lang.String boxingMethodDescriptor)
Creates a new primitive boxing delegate.- Parameters:
wrapperType
- A description of a wrapper type.sizeDifference
- The size difference between a primitive type and its wrapper type.boxingMethodName
- The name of the method for boxing a primitive value as its wrapper type.boxingMethodDescriptor
- The descriptor of the method for boxing a primitive value as its wrapper type.
-
-
Method Detail
-
values
public static PrimitiveBoxingDelegate[] 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 (PrimitiveBoxingDelegate c : PrimitiveBoxingDelegate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveBoxingDelegate 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 PrimitiveBoxingDelegate forPrimitive(TypeDefinition typeDefinition)
Locates a boxing delegate for a given primitive type.- Parameters:
typeDefinition
- A non-void primitive type.- Returns:
- A delegate capable of boxing the given primitive type.
-
assignBoxedTo
public StackManipulation assignBoxedTo(TypeDescription.Generic target, Assigner chainedAssigner, Assigner.Typing typing)
Creates a stack manipulation that boxes the represented primitive type and applies a chained assignment to the result of this boxing operation.- Parameters:
target
- The type that is target of the assignment operation.chainedAssigner
- The assigner that is to be used to perform the chained assignment.typing
- Determines if an assignment to an incompatible type should be enforced by a casting.- Returns:
- A stack manipulation that represents the described assignment operation.
-
-