Enum Class PrimitiveBoxingDelegate
java.lang.Object
java.lang.Enum<PrimitiveBoxingDelegate>
net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveBoxingDelegate
- All Implemented Interfaces:
Serializable,Comparable<PrimitiveBoxingDelegate>,Constable
This delegate is responsible for boxing a primitive types to their wrapper equivalents.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA stack manipulation for boxing a primitive type into its wrapper type.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe boxing delegate forbooleanvalues.The boxing delegate forbytevalues.The boxing delegate forcharvalues.The boxing delegate fordoublevalues.The boxing delegate forfloatvalues.The boxing delegate forintvalues.The boxing delegate forlongvalues.The boxing delegate forshortvalues. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe descriptor of the method for boxing a primitive value as its wrapper type.private final StringThe name of the method for boxing a primitive value as its wrapper type.private final StackManipulation.SizeThe size decrease after a primitive type was wrapped.private final TypeDescriptionA description of a wrapper type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrimitiveBoxingDelegate(Class<?> wrapperType, StackSize sizeDifference, String boxingMethodName, String boxingMethodDescriptor) Creates a new primitive boxing delegate. -
Method Summary
Modifier and TypeMethodDescriptionassignBoxedTo(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 PrimitiveBoxingDelegateforPrimitive(TypeDefinition typeDefinition) Locates a boxing delegate for a given primitive type.static PrimitiveBoxingDelegateReturns the enum constant of this class with the specified name.static PrimitiveBoxingDelegate[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BOOLEAN
The boxing delegate forbooleanvalues. -
BYTE
The boxing delegate forbytevalues. -
SHORT
The boxing delegate forshortvalues. -
CHARACTER
The boxing delegate forcharvalues. -
INTEGER
The boxing delegate forintvalues. -
LONG
The boxing delegate forlongvalues. -
FLOAT
The boxing delegate forfloatvalues. -
DOUBLE
The boxing delegate fordoublevalues.
-
-
Field Details
-
wrapperType
A description of a wrapper type. -
size
The size decrease after a primitive type was wrapped. -
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.
-
-
Constructor Details
-
PrimitiveBoxingDelegate
private PrimitiveBoxingDelegate(Class<?> wrapperType, StackSize sizeDifference, String boxingMethodName, 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 Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
forPrimitive
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.
-