Package net.bytebuddy.utility
Class JavaConstant.Simple.OfTypeDescription
- java.lang.Object
-
- net.bytebuddy.utility.JavaConstant.Simple<TypeDescription>
-
- net.bytebuddy.utility.JavaConstant.Simple.OfTypeDescription
-
- All Implemented Interfaces:
JavaConstant
- Enclosing class:
- JavaConstant.Simple<T>
protected static class JavaConstant.Simple.OfTypeDescription extends JavaConstant.Simple<TypeDescription>
Represents a type constant.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.utility.JavaConstant.Simple
JavaConstant.Simple.Dispatcher, JavaConstant.Simple.OfTrivialValue<S>, JavaConstant.Simple.OfTypeDescription
-
Nested classes/interfaces inherited from interface net.bytebuddy.utility.JavaConstant
JavaConstant.Dynamic, JavaConstant.MethodHandle, JavaConstant.MethodType, JavaConstant.Simple<T>, JavaConstant.Visitor<T>
-
-
Field Summary
-
Fields inherited from class net.bytebuddy.utility.JavaConstant.Simple
CLASS_DESC, CONSTANT_DESC, DIRECT_METHOD_HANDLE_DESC, DIRECT_METHOD_HANDLE_DESC_KIND, DYNAMIC_CONSTANT_DESC, METHOD_HANDLE_DESC, METHOD_TYPE_DESC, value
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
OfTypeDescription(TypeDescription value)
Creates a type constant.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(JavaConstant.Visitor<T> visitor)
Applies the supplied visitor to this constant type with its respective callback.java.lang.Object
toDescription()
Returns this constant as a Javajava.lang.constant.ConstantDesc
if the current VM is of at least version 12.-
Methods inherited from class net.bytebuddy.utility.JavaConstant.Simple
equals, getTypeDescription, getValue, hashCode, of, ofDescription, ofDescription, ofDescription, ofLoaded, toString, wrap, wrap
-
-
-
-
Constructor Detail
-
OfTypeDescription
protected OfTypeDescription(TypeDescription value)
Creates a type constant.- Parameters:
value
- The represented type.
-
-
Method Detail
-
toDescription
public java.lang.Object toDescription()
Returns this constant as a Javajava.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.- Returns:
- This constant as a Java
java.lang.constant.ConstantDesc
.
-
accept
public <T> T accept(JavaConstant.Visitor<T> visitor)
Applies the supplied visitor to this constant type with its respective callback.- Type Parameters:
T
- The type of the value that is returned by the visitor.- Parameters:
visitor
- The visitor to dispatch.- Returns:
- The value that is returned by the supplied visitor.
-
-