Class ClassType
- All Implemented Interfaces:
Descriptor
Note that an inner class type enclosed in a parameterized type or in a type
annotated with a type annotation is represented as ParameterizedType,
where the enclosing type is represented as the parameterized type's owner.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypestatic final ClassTypeFields inherited from class Type
EMPTY_ARRAYFields inherited from interface Descriptor
NO_SUBSTITUTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aClassTypeand returns it if the kind isType.Kind.CLASS.static ClassType.BuilderCreate a builder of a class type for the given class.static ClassType.BuilderCreate a builder of a class type with the givenname.(package private) TypecopyType(AnnotationInstance[] newAnnotations) static ClassTypeCreate an instance of a class type for givenclazz.static ClassTypeCreate an instance of a class type with givenname.static ClassTypeCreate an instance of a class type with givenname.kind()Returns the kind of Type this is.(package private) ParameterizedTypeMethods inherited from class Type
addAnnotation, annotation, annotationArray, annotations, annotationsWithRepeatable, appendAnnotations, asArrayType, asParameterizedType, asPrimitiveType, asTypeVariable, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, descriptor, equals, hasAnnotation, hashCode, internEquals, internHashCode, name, parse, toString, toString, withoutAnnotationsMethods inherited from interface Descriptor
descriptor
-
Field Details
-
OBJECT_TYPE
-
STRING_TYPE
-
CLASS_TYPE
-
BYTE_CLASS
-
CHARACTER_CLASS
-
DOUBLE_CLASS
-
FLOAT_CLASS
-
INTEGER_CLASS
-
LONG_CLASS
-
SHORT_CLASS
-
BOOLEAN_CLASS
-
VOID_CLASS
-
-
Constructor Details
-
ClassType
ClassType(DotName name) -
ClassType
ClassType(DotName name, AnnotationInstance[] annotations)
-
-
Method Details
-
create
Create an instance of a class type with givenname.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType, where the enclosing type is represented as the parameterized type's owner.- Parameters:
name- the binary name of this class type- Returns:
- the class type
- Since:
- 3.0.4
-
create
Create an instance of a class type with givenname.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType, where the enclosing type is represented as the parameterized type's owner.- Parameters:
name- the binary name of this class type- Returns:
- the class type
- Since:
- 3.1.0
-
create
Create an instance of a class type for givenclazz.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType, where the enclosing type is represented as the parameterized type's owner.- Parameters:
clazz- the class- Returns:
- the class type
- Since:
- 3.1.0
-
builder
Create a builder of a class type with the givenname.- Parameters:
name- binary name of the class- Returns:
- the builder
- Since:
- 3.1.0
-
builder
Create a builder of a class type for the given class.- Parameters:
clazz- the class- Returns:
- the builder
- Since:
- 3.1.0
-
kind
-
asClassType
Description copied from class:TypeCasts this type to aClassTypeand returns it if the kind isType.Kind.CLASS. Throws an exception otherwise.- Overrides:
asClassTypein classType- Returns:
- a
ClassType
-
copyType
-
toParameterizedType
ParameterizedType toParameterizedType()
-