- All Superinterfaces:
Constable,Expr,SimpleTyped,Typed
An expression which wraps a
ConstantDesc.-
Method Summary
Modifier and TypeMethodDescriptiondesc()Returns the description of the constant.static Constof(boolean value) Returns a constant for the given value.static Constof(byte value) Returns a constant for the given value.static Constof(char value) Returns a constant for the given value.static Constof(double value) Returns a constant for the given value.static ConstReturns a constant for the given value.static Constof(float value) Returns a constant for the given value.static ConstReturns a constant for the given value.static Constof(int value) Returns a constant for the given value.static ConstReturns a constant for the given value.static Constof(long value) Returns a constant for the given value.static ConstReturns a constant for the given value.static Constof(short value) Returns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given Constable.static Constof(ConstantDesc constantDesc) Returns a constant for the given description.static Constof(DynamicConstantDesc<?> dcd) Returns a constant for the given description.static Constof(MethodHandleDesc desc) Returns a method handle constant from the given descriptor.static Constof(MethodTypeDesc desc) Returns a method type constant from the given descriptor.static ConstReturns a constant for the given value.static Constof(Enum.EnumDesc<?> value) Returns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static Constof(VarHandle.VarHandleDesc value) Returns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a constant for the given value.static ConstReturns a list constant containing the given items.static ConstReturns a map entry constant with the key and value of the given entry.static ConstReturns a map constant containing the given items.static ConstReturns a set constant containing the given items.static ConstofArrayVarHandle(ClassDesc arrayType) Returns aVarHandleconstant for the given array type.static ConstReturns a method handle constant from the given constructor descriptor.static ConstReturns a constant with the default value of giventype.static ConstReturns a constant with the default value of giventype.static ConstReturns a method handle for an instance field getter.static ConstReturns a method handle for an instance field setter.static ConstofFieldVarHandle(FieldDesc desc) Returns aVarHandleconstant for the given instance field.static ConstReturns a constant whose value is the result of a one-time method invocation.static ConstReturns a constant whose value is the result of a one-time method invocation.static ConstofMethodHandle(InvokeKind kind, MethodDesc desc) Returns a method handle constant from the given information.static ConstReturns anullconstant with the given type.static ConstReturns anullconstant with the given type.static ConstReturns a method handle for a static field getter.static ConstReturns a method handle for a static field setter.static ConstReturns aVarHandleconstant for the given static field.static ConstofStaticFinalField(FieldDesc desc) Returns a constant with the value of the givenstatic finalfield.static ConstofVoid()Returns thevoidconstant.Methods inherited from interface java.lang.constant.Constable
describeConstableMethods inherited from interface io.quarkus.gizmo2.Expr
elem, elem, elem, field, field, field, field, genericType, hasGenericType, length, typeMethods inherited from interface io.quarkus.gizmo2.SimpleTyped
isPrimitive, isVoid, slotSize, typeKind
-
Method Details
-
desc
ConstantDesc desc()Returns the description of the constant.- Returns:
- the description of the constant
-
of
Returns a constant for the given Constable.- Parameters:
constable- the object to create a constant from (must not benull)- Returns:
- a constant for the given Constable
-
of
Returns a constant for the given description.- Parameters:
constantDesc- the object to create a constant from (must not benull)- Returns:
- a constant for the given description
-
of
Returns a constant for the given description.- Parameters:
dcd- the object to create a constant from (must not benull)- Returns:
- a constant for the given description
-
ofNull
Returns anullconstant with the given type.- Parameters:
type- the type of the null constant (used for inference of type) (must not benull)- Returns:
- a
nullconstant with the given type
-
ofNull
Returns anullconstant with the given type.- Parameters:
type- the type of the null constant (used for inference of type) (must not benull)- Returns:
- a
nullconstant with the given type
-
ofDefault
Returns a constant with the default value of giventype. This is zero for primitive types andnullfor reference types.- Parameters:
type- the type of the constant (must not benull)- Returns:
- a constant with the default value of given
type
-
ofDefault
Returns a constant with the default value of giventype. This is zero for primitive types andnullfor reference types.- Parameters:
type- the type of the constant (must not benull)- Returns:
- a constant with the default value of given
type
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant fromtypeKind- the (numeric) kind of value to use for inference (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant fromtypeKind- the (numeric) kind of value to use for inference (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant fromtypeKind- the (numeric) kind of value to use for inference (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant fromtypeKind- the (numeric) kind of value to use for inference (must not benull)- Returns:
- a constant for the given value
-
of
Returns a constant for the given value.- Parameters:
value- the value to create a constant from (must not benull)- Returns:
- a constant for the given value
-
ofVoid
Returns thevoidconstant.- Returns:
- the
voidconstant
-
ofFieldVarHandle
Returns aVarHandleconstant for the given instance field.- Parameters:
desc- the descriptor of the field (must not benull)- Returns:
- a
VarHandleconstant for the given instance field
-
ofStaticFieldVarHandle
Returns aVarHandleconstant for the given static field.- Parameters:
desc- the descriptor of the field (must not benull)- Returns:
- a
VarHandleconstant for the given static field
-
ofStaticFinalField
Returns a constant with the value of the givenstatic finalfield.- Parameters:
desc- the descriptor of the field (must not benull)- Returns:
- a constant with the value of the given
static finalfield
-
ofArrayVarHandle
Returns aVarHandleconstant for the given array type.- Parameters:
arrayType- the array type (must not benull)- Returns:
- a
VarHandleconstant for the given array type
-
ofInvoke
Returns a constant whose value is the result of a one-time method invocation. Note that due to the nature of dynamic constants, parallel threads may cause the method to be invoked more than once.- Parameters:
methodHandle- the method handle to invoke (must not benull)args- the list of arguments (must not benull)- Returns:
- a constant whose value is the result of a one-time method invocation
-
ofInvoke
Returns a constant whose value is the result of a one-time method invocation. Note that due to the nature of dynamic constants, parallel threads may cause the method to be invoked more than once.- Parameters:
methodHandle- the method handle to invoke (must not benull)args- the list of arguments (must not benull)- Returns:
- a constant whose value is the result of a one-time method invocation
-
of
Returns a method handle constant from the given descriptor.- Parameters:
desc- the method handle descriptor (must not benull)- Returns:
- a method handle constant from the given descriptor
-
ofMethodHandle
Returns a method handle constant from the given information.- Parameters:
kind- the invocation kind (must not benull)desc- the method's descriptor (must not benull)- Returns:
- a method handle constant from the given information
-
ofConstructorMethodHandle
Returns a method handle constant from the given constructor descriptor.- Parameters:
desc- the constructor descriptor (must not benull)- Returns:
- a method handle constant from the given constructor descriptor
-
ofFieldSetterMethodHandle
Returns a method handle for an instance field setter.- Parameters:
desc- the field descriptor (must not benull)- Returns:
- a method handle for an instance field setter
-
ofFieldGetterMethodHandle
Returns a method handle for an instance field getter.- Parameters:
desc- the field descriptor (must not benull)- Returns:
- a method handle for an instance field getter
-
ofStaticFieldSetterMethodHandle
Returns a method handle for a static field setter.- Parameters:
desc- the field descriptor (must not benull)- Returns:
- a method handle for a static field setter
-
ofStaticFieldGetterMethodHandle
Returns a method handle for a static field getter.- Parameters:
desc- the field descriptor (must not benull)- Returns:
- a method handle for a static field getter
-
of
Returns a method type constant from the given descriptor.- Parameters:
desc- the method type descriptor (must not benull)- Returns:
- a method type constant from the given descriptor
-
of
Returns a list constant containing the given items. The maximum number of items is around 254 (depending on the constant type); however, this method should only be used for relatively short lists to avoid overfilling the constant pool. Note that the JDK immutable collection types forbidnull, sonullvalues should not be used.- Parameters:
items- the list of items, which must beConst,Constable, orConstantDescsubtypes (must not benull)- Returns:
- a list constant containing the given items
-
of
Returns a set constant containing the given items. The maximum number of items is around 254 (depending on the constant type); however, this method should only be used for relatively small sets to avoid overfilling the constant pool. Note that the JDK immutable collection types forbidnull, sonullvalues should not be used.- Parameters:
items- the set of items, which must beConst,Constable, orConstantDescsubtypes (must not benull)- Returns:
- a set constant containing the given items
-
of
Returns a map constant containing the given items. The maximum number of items is around 254 (depending on the constant type); however, this method should only be used for relatively small maps to avoid overfilling the constant pool. Note that the JDK immutable collection types forbidnull, sonullvalues should not be used.- Parameters:
items- the set of items, which must beConst,Constable, orConstantDescsubtypes (must not benull)- Returns:
- a map constant containing the given items
-
of
Returns a map entry constant with the key and value of the given entry.- Parameters:
entry- the map entry containing a constant key and value, which must beConst,Constable, orConstantDescsubtypes (must not benull)- Returns:
- a map entry constant with the key and value of the given entry
-