Enum Class PrimitiveWideningDelegate
java.lang.Object
java.lang.Enum<PrimitiveWideningDelegate>
net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveWideningDelegate
- All Implemented Interfaces:
Serializable
,Comparable<PrimitiveWideningDelegate>
,Constable
This delegate is responsible for widening a primitive type to represent a larger primitive type. The
rules for this widening are equivalent to those in the JLS.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A stack manipulation that widens a primitive type into a more general primitive type.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe widening delegate forboolean
values.The widening delegate forbyte
values.The widening delegate forchar
values.The widening delegate fordouble
values.The widening delegate forfloat
values.The widening delegate forint
values.The widening delegate forlong
values.The widening delegate forshort
values. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulation
A stack manipulation that widens the type that is represented by this instance to aboolean
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to abyte
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to achar
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to adouble
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to afloat
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to aint
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to along
.private final StackManipulation
A stack manipulation that widens the type that is represented by this instance to ashort
. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PrimitiveWideningDelegate
(StackManipulation toBooleanStackManipulation, StackManipulation toByteStackManipulation, StackManipulation toShortStackManipulation, StackManipulation toCharacterStackManipulation, StackManipulation toIntegerStackManipulation, StackManipulation toLongStackManipulation, StackManipulation toFloatStackManipulation, StackManipulation toDoubleStackManipulation) Creates a new primitive widening delegate. -
Method Summary
Modifier and TypeMethodDescriptionstatic PrimitiveWideningDelegate
forPrimitive
(TypeDefinition typeDefinition) Locates the delegate that is capable of widening the given type into another type.static PrimitiveWideningDelegate
Returns the enum constant of this class with the specified name.static PrimitiveWideningDelegate[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.widenTo
(TypeDefinition typeDefinition) Attempts to widen the represented type into another type.
-
Enum Constant Details
-
BOOLEAN
The widening delegate forboolean
values. -
BYTE
The widening delegate forbyte
values. -
SHORT
The widening delegate forshort
values. -
CHARACTER
The widening delegate forchar
values. -
INTEGER
The widening delegate forint
values. -
LONG
The widening delegate forlong
values. -
FLOAT
The widening delegate forfloat
values. -
DOUBLE
The widening delegate fordouble
values.
-
-
Field Details
-
toBooleanStackManipulation
A stack manipulation that widens the type that is represented by this instance to aboolean
. -
toByteStackManipulation
A stack manipulation that widens the type that is represented by this instance to abyte
. -
toShortStackManipulation
A stack manipulation that widens the type that is represented by this instance to ashort
. -
toCharacterStackManipulation
A stack manipulation that widens the type that is represented by this instance to achar
. -
toIntegerStackManipulation
A stack manipulation that widens the type that is represented by this instance to aint
. -
toLongStackManipulation
A stack manipulation that widens the type that is represented by this instance to along
. -
toFloatStackManipulation
A stack manipulation that widens the type that is represented by this instance to afloat
. -
toDoubleStackManipulation
A stack manipulation that widens the type that is represented by this instance to adouble
.
-
-
Constructor Details
-
PrimitiveWideningDelegate
private PrimitiveWideningDelegate(StackManipulation toBooleanStackManipulation, StackManipulation toByteStackManipulation, StackManipulation toShortStackManipulation, StackManipulation toCharacterStackManipulation, StackManipulation toIntegerStackManipulation, StackManipulation toLongStackManipulation, StackManipulation toFloatStackManipulation, StackManipulation toDoubleStackManipulation) Creates a new primitive widening delegate.- Parameters:
toBooleanStackManipulation
- A stack manipulation that widens the type that is represented by this instance to aboolean
.toByteStackManipulation
- A stack manipulation that widens the type that is represented by this instance to abyte
.toShortStackManipulation
- A stack manipulation that widens the type that is represented by this instance to ashort
.toCharacterStackManipulation
- A stack manipulation that widens the type that is represented by this instance to achar
.toIntegerStackManipulation
- A stack manipulation that widens the type that is represented by this instance to aint
.toLongStackManipulation
- A stack manipulation that widens the type that is represented by this instance to along
.toFloatStackManipulation
- A stack manipulation that widens the type that is represented by this instance to afloat
.toDoubleStackManipulation
- A stack manipulation that widens the type that is represented by this instance to adouble
.
-
-
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 the delegate that is capable of widening the given type into another type.- Parameters:
typeDefinition
- A non-void primitive type that is to be widened into another type.- Returns:
- A delegate for the given type.
-
widenTo
Attempts to widen the represented type into another type.- Parameters:
typeDefinition
- A non-void primitive type that is the expected result of the widening operation.- Returns:
- A widening instruction or an illegal stack manipulation if such widening is not legitimate.
-