Class ConstantValue.Simple
java.lang.Object
net.bytebuddy.utility.ConstantValue.Simple
- All Implemented Interfaces:
ConstantValue
- Enclosing interface:
ConstantValue
A simple representation of a constant value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ConstantValue
ConstantValue.Simple -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulationA stack manipulation that loads a constant.private final TypeDescriptionThe description of the constant value's type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimple(StackManipulation stackManipulation, TypeDescription typeDescription) Creates a simple constant value. -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the type of this constant.Returns a stack manipulation loading this value.static ConstantValueReturns a constant value for the supplied constant value.static ConstantValuewrapOrNull(Object value) Returns a constant value for the supplied constant value.
-
Field Details
-
stackManipulation
A stack manipulation that loads a constant. -
typeDescription
The description of the constant value's type.
-
-
Constructor Details
-
Simple
Creates a simple constant value.- Parameters:
stackManipulation- A stack manipulation that loads a constant.typeDescription- The description of the constant value's type.
-
-
Method Details
-
wrap
Returns a constant value for the supplied constant value.- Parameters:
value- The value to represent as a constant.- Returns:
- An appropriate representation of the constant value.
-
wrapOrNull
Returns a constant value for the supplied constant value.- Parameters:
value- The value to represent as a constant.- Returns:
- An appropriate representation of the constant value or
nullif the supplied value is not representable as a compile-time constant.
-
getTypeDescription
Returns a description of the type of this constant.- Specified by:
getTypeDescriptionin interfaceConstantValue- Returns:
- A description of the type of this constant.
-
toStackManipulation
Returns a stack manipulation loading this value.- Specified by:
toStackManipulationin interfaceConstantValue- Returns:
- A stack manipulation loading this value.
-