Package io.micronaut.sourcegen.model
Interface TypeDef
- All Known Subinterfaces:
ClassTypeDef
,TypeDef.Annotated
- All Known Implementing Classes:
ClassTypeDef.AnnotatedClassTypeDef
,ClassTypeDef.ClassDefType
,ClassTypeDef.ClassElementType
,ClassTypeDef.ClassName
,ClassTypeDef.JavaClass
,ClassTypeDef.Parameterized
,TypeDef.AnnotatedTypeDef
,TypeDef.Array
,TypeDef.Primitive
,TypeDef.TypeVariable
,TypeDef.Wildcard
public sealed interface TypeDef
permits ClassTypeDef, TypeDef.Annotated, TypeDef.Array, TypeDef.Primitive, TypeDef.TypeVariable, TypeDef.Wildcard
The type definition.
Not-null by default.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A combined type interface for representing a Type with annotations.static final record
A combined type for representing a TypeDef with annotations.static final record
The type for representing an array.static final record
The primitive type name.static final record
The type variable ref.static final record
The wildcard type definition. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ClassTypeDef
static final ClassTypeDef
static final ClassTypeDef
static final ClassTypeDef
A simple type representing a special super-type, in context of a class def, method or field the type will be replaced by the current super type.static final ClassTypeDef
A simple type representing a special this-type, in context of a class def, method or field the type will be replaced by the current type.static final TypeDef.Primitive
-
Method Summary
Modifier and TypeMethodDescriptiondefault TypeDef.Annotated
annotated
(AnnotationDef... annotations) Define a type with annotations.default TypeDef.Annotated
annotated
(List<AnnotationDef> annotations) Define a type with annotations.default TypeDef.Array
array()
Create an array type.default TypeDef.Array
array
(int dimension) Create an array type.static TypeDef.Array
static TypeDef.Array
static TypeDef
erasure
(io.micronaut.inject.ast.TypedElement typedElement) Creates a new type erasure.default boolean
isArray()
default boolean
default boolean
default TypeDef
static TypeDef
of
(io.micronaut.inject.ast.TypedElement typedElement) Creates a new type.static TypeDef
Creates a new type.static TypeDef
Create a new type definition.static ClassTypeDef
parameterized
(ClassTypeDef type, TypeDef... genericParameters) Creates a new type with generic parameters.static ClassTypeDef
parameterized
(ClassTypeDef type, Class<?>... genericParameters) Creates a new type with generic parameters.static ClassTypeDef
parameterized
(ClassTypeDef type, List<TypeDef> genericParameters) Creates a new type with generic parameters.static ClassTypeDef
parameterized
(Class<?> type, TypeDef... genericParameters) Creates a new type with generic parameters.static ClassTypeDef
parameterized
(Class<?> type, Class<?>... genericParameters) Creates a new type with generic parameters.static TypeDef.Primitive
Creates new primitive type.static TypeDef.Primitive
Creates new primitive type.static TypeDef.TypeVariable
Creates a new type variable.static TypeDef.TypeVariable
Creates a new type variable.static TypeDef.Wildcard
wildcard()
static TypeDef.Wildcard
wildcardSubtypeOf
(TypeDef upperBound) static TypeDef.Wildcard
wildcardSupertypeOf
(TypeDef lowerBound)
-
Field Details
-
VOID
-
OBJECT
-
CLASS
-
STRING
-
THIS
A simple type representing a special this-type, in context of a class def, method or field the type will be replaced by the current type. -
SUPER
A simple type representing a special super-type, in context of a class def, method or field the type will be replaced by the current super type.
-
-
Method Details
-
annotated
Define a type with annotations.- Parameters:
annotations
- the annotation definitions to be added- Returns:
- The AnnotatedTypeDef
- Since:
- 1.4
-
annotated
Define a type with annotations.- Parameters:
annotations
- The list of the AnnotationDef- Returns:
- The AnnotatedTypeDef
- Since:
- 1.4
-
array
Create an array type.- Returns:
- The array type
- Since:
- 1.5
-
array
Create an array type.- Parameters:
dimension
- The dimension of the array- Returns:
- The array type
- Since:
- 1.5
-
of
Create a new type definition.- Parameters:
name
- The type name- Returns:
- type definition
- Since:
- 1.5
-
primitive
Creates new primitive type.- Parameters:
type
- The primitive type- Returns:
- a new type definition
-
primitive
Creates new primitive type.- Parameters:
type
- The primitive type- Returns:
- a new type definition
-
wildcard
-
wildcardSubtypeOf
-
wildcardSupertypeOf
-
array
-
array
-
of
Creates a new type.- Parameters:
type
- The type- Returns:
- a new type definition
-
parameterized
Creates a new type with generic parameters.- Parameters:
type
- The typegenericParameters
- The parameters- Returns:
- a new type definition
-
parameterized
Creates a new type with generic parameters.- Parameters:
type
- The typegenericParameters
- The parameters- Returns:
- a new type definition
-
parameterized
Creates a new type with generic parameters.- Parameters:
type
- The typegenericParameters
- The parameters- Returns:
- a new type definition
-
parameterized
Creates a new type with generic parameters.- Parameters:
type
- The typegenericParameters
- The parameters- Returns:
- a new type definition
-
parameterized
Creates a new type with generic parameters.- Parameters:
type
- The typegenericParameters
- The parameters- Returns:
- a new type definition
-
variable
Creates a new type variable.- Parameters:
name
- The typebounds
- The bounds- Returns:
- a new type variable
-
variable
Creates a new type variable.- Parameters:
name
- The typebounds
- The bounds- Returns:
- a new type variable
-
of
Creates a new type.- Parameters:
typedElement
- The typed element- Returns:
- a new type definition
-
erasure
Creates a new type erasure.- Parameters:
typedElement
- The typed element- Returns:
- a new type definition
-
isNullable
default boolean isNullable()- Returns:
- Is nullable type
-
isPrimitive
default boolean isPrimitive()- Returns:
- Is primitive type
-
isArray
default boolean isArray()- Returns:
- Is Array type
-
makeNullable
- Returns:
- A new nullable type
-