Enum PrimitiveWideningDelegate
- java.lang.Object
-
- java.lang.Enum<PrimitiveWideningDelegate>
-
- net.bytebuddy.implementation.bytecode.assign.primitive.PrimitiveWideningDelegate
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PrimitiveWideningDelegate>
public enum PrimitiveWideningDelegate extends java.lang.Enum<PrimitiveWideningDelegate>
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 Classes Modifier and Type Class Description protected static class
PrimitiveWideningDelegate.WideningStackManipulation
A stack manipulation that widens a primitive type into a more general primitive type.
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
The widening delegate forboolean
values.BYTE
The widening delegate forbyte
values.CHARACTER
The widening delegate forchar
values.DOUBLE
The widening delegate fordouble
values.FLOAT
The widening delegate forfloat
values.INTEGER
The widening delegate forint
values.LONG
The widening delegate forlong
values.SHORT
The widening delegate forshort
values.
-
Field Summary
Fields Modifier and Type Field Description private StackManipulation
toBooleanStackManipulation
A stack manipulation that widens the type that is represented by this instance to aboolean
.private StackManipulation
toByteStackManipulation
A stack manipulation that widens the type that is represented by this instance to abyte
.private StackManipulation
toCharacterStackManipulation
A stack manipulation that widens the type that is represented by this instance to achar
.private StackManipulation
toDoubleStackManipulation
A stack manipulation that widens the type that is represented by this instance to adouble
.private StackManipulation
toFloatStackManipulation
A stack manipulation that widens the type that is represented by this instance to afloat
.private StackManipulation
toIntegerStackManipulation
A stack manipulation that widens the type that is represented by this instance to aint
.private StackManipulation
toLongStackManipulation
A stack manipulation that widens the type that is represented by this instance to along
.private StackManipulation
toShortStackManipulation
A stack manipulation that widens the type that is represented by this instance to ashort
.
-
Constructor Summary
Constructors Modifier Constructor Description private
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrimitiveWideningDelegate
forPrimitive(TypeDefinition typeDefinition)
Locates the delegate that is capable of widening the given type into another type.static PrimitiveWideningDelegate
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PrimitiveWideningDelegate[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.StackManipulation
widenTo(TypeDefinition typeDefinition)
Attempts to widen the represented type into another type.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final PrimitiveWideningDelegate BOOLEAN
The widening delegate forboolean
values.
-
BYTE
public static final PrimitiveWideningDelegate BYTE
The widening delegate forbyte
values.
-
SHORT
public static final PrimitiveWideningDelegate SHORT
The widening delegate forshort
values.
-
CHARACTER
public static final PrimitiveWideningDelegate CHARACTER
The widening delegate forchar
values.
-
INTEGER
public static final PrimitiveWideningDelegate INTEGER
The widening delegate forint
values.
-
LONG
public static final PrimitiveWideningDelegate LONG
The widening delegate forlong
values.
-
FLOAT
public static final PrimitiveWideningDelegate FLOAT
The widening delegate forfloat
values.
-
DOUBLE
public static final PrimitiveWideningDelegate DOUBLE
The widening delegate fordouble
values.
-
-
Field Detail
-
toBooleanStackManipulation
private final StackManipulation toBooleanStackManipulation
A stack manipulation that widens the type that is represented by this instance to aboolean
.
-
toByteStackManipulation
private final StackManipulation toByteStackManipulation
A stack manipulation that widens the type that is represented by this instance to abyte
.
-
toShortStackManipulation
private final StackManipulation toShortStackManipulation
A stack manipulation that widens the type that is represented by this instance to ashort
.
-
toCharacterStackManipulation
private final StackManipulation toCharacterStackManipulation
A stack manipulation that widens the type that is represented by this instance to achar
.
-
toIntegerStackManipulation
private final StackManipulation toIntegerStackManipulation
A stack manipulation that widens the type that is represented by this instance to aint
.
-
toLongStackManipulation
private final StackManipulation toLongStackManipulation
A stack manipulation that widens the type that is represented by this instance to along
.
-
toFloatStackManipulation
private final StackManipulation toFloatStackManipulation
A stack manipulation that widens the type that is represented by this instance to afloat
.
-
toDoubleStackManipulation
private final StackManipulation toDoubleStackManipulation
A stack manipulation that widens the type that is represented by this instance to adouble
.
-
-
Constructor Detail
-
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 Detail
-
values
public static PrimitiveWideningDelegate[] 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 (PrimitiveWideningDelegate c : PrimitiveWideningDelegate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveWideningDelegate 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 PrimitiveWideningDelegate forPrimitive(TypeDefinition typeDefinition)
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
public StackManipulation widenTo(TypeDefinition typeDefinition)
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.
-
-