public static class JavaConstant.Simple extends Object implements JavaConstant
JavaConstant.Dynamic, JavaConstant.MethodHandle, JavaConstant.MethodType, JavaConstant.Simple
Modifier | Constructor and Description |
---|---|
protected |
Simple(Object value,
TypeDescription typeDescription)
Creates a simple Java constant.
|
Modifier and Type | Method and Description |
---|---|
Object |
asConstantPoolValue()
Returns the represented instance as a constant pool value.
|
boolean |
equals(Object object) |
TypeDescription |
getTypeDescription()
Returns a description of the type of the represented instance or at least a stub.
|
int |
hashCode() |
static JavaConstant |
of(TypeDescription typeDescription)
Returns a Java constant representation for a
TypeDescription . |
static JavaConstant |
ofLoaded(Object value)
Resolves a loaded Java value to a Java constant representation.
|
static List<JavaConstant> |
wrap(List<?> values)
Wraps a list of either loaded or unloaded constant representations as
JavaConstant instances. |
static JavaConstant |
wrap(Object value)
Wraps a value representing a loaded or unloaded constant as
JavaConstant instance. |
protected Simple(Object value, TypeDescription typeDescription)
value
- The represented constant pool value.typeDescription
- A description of the type of the constant.public static JavaConstant ofLoaded(Object value)
value
- The value to represent.public static JavaConstant of(TypeDescription typeDescription)
TypeDescription
.typeDescription
- The type to represent as a constant.public static JavaConstant wrap(Object value)
JavaConstant
instance.value
- The value to wrap.public static List<JavaConstant> wrap(List<?> values)
JavaConstant
instances.values
- The values to wrap.public Object asConstantPoolValue()
asConstantPoolValue
in interface JavaConstant
public TypeDescription getTypeDescription()
getTypeDescription
in interface JavaConstant
Copyright © 2014–2021. All rights reserved.