S
- The represented type.protected static class JavaConstant.Simple.OfTrivialValue<S> extends JavaConstant.Simple<S>
JavaConstant.Simple.Dispatcher, JavaConstant.Simple.OfTrivialValue<S>, JavaConstant.Simple.OfTypeDescription
JavaConstant.Dynamic, JavaConstant.MethodHandle, JavaConstant.MethodType, JavaConstant.Simple<T>, JavaConstant.Visitor<T>
CLASS_DESC, CONSTANT_DESC, DIRECT_METHOD_HANDLE_DESC, DIRECT_METHOD_HANDLE_DESC_KIND, DYNAMIC_CONSTANT_DESC, METHOD_HANDLE_DESC, METHOD_TYPE_DESC, value
Modifier | Constructor and Description |
---|---|
protected |
OfTrivialValue(S value,
TypeDescription typeDescription)
Creates a representation of a trivial constant that represents itself.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(JavaConstant.Visitor<T> visitor)
Applies the supplied visitor to this constant type with its respective callback.
|
Object |
toDescription()
Returns this constant as a Java
java.lang.constant.ConstantDesc if the current VM is of at least version 12. |
equals, getTypeDescription, getValue, hashCode, of, ofDescription, ofDescription, ofDescription, ofLoaded, toString, wrap, wrap
protected OfTrivialValue(S value, TypeDescription typeDescription)
value
- The represented value.typeDescription
- The represented value's type.public Object toDescription()
java.lang.constant.ConstantDesc
if the current VM is of at least version 12.
If the current VM is of an older version and does not support the type, an exception is thrown.java.lang.constant.ConstantDesc
.public <T> T accept(JavaConstant.Visitor<T> visitor)
T
- The type of the value that is returned by the visitor.visitor
- The visitor to dispatch.Copyright © 2014–1970. All rights reserved.