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

The type definition. Not-null by default.
Since:
1.0
Author:
Denis Stepanov
  • Field Details

    • VOID

      static final TypeDef.Primitive VOID
    • OBJECT

      static final ClassTypeDef OBJECT
    • CLASS

      static final ClassTypeDef CLASS
    • STRING

      static final ClassTypeDef STRING
    • THIS

      static final ClassTypeDef 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

      static final ClassTypeDef 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

      default TypeDef.Annotated annotated(AnnotationDef... annotations)
      Define a type with annotations.
      Parameters:
      annotations - the annotation definitions to be added
      Returns:
      The AnnotatedTypeDef
      Since:
      1.4
    • annotated

      default TypeDef.Annotated annotated(List<AnnotationDef> annotations)
      Define a type with annotations.
      Parameters:
      annotations - The list of the AnnotationDef
      Returns:
      The AnnotatedTypeDef
      Since:
      1.4
    • array

      default TypeDef.Array array()
      Create an array type.
      Returns:
      The array type
      Since:
      1.5
    • array

      default TypeDef.Array array(int dimension)
      Create an array type.
      Parameters:
      dimension - The dimension of the array
      Returns:
      The array type
      Since:
      1.5
    • of

      static TypeDef of(String name)
      Create a new type definition.
      Parameters:
      name - The type name
      Returns:
      type definition
      Since:
      1.5
    • primitive

      static TypeDef.Primitive primitive(String type)
      Creates new primitive type.
      Parameters:
      type - The primitive type
      Returns:
      a new type definition
    • primitive

      static TypeDef.Primitive primitive(Class<?> type)
      Creates new primitive type.
      Parameters:
      type - The primitive type
      Returns:
      a new type definition
    • wildcard

      static TypeDef.Wildcard wildcard()
    • wildcardSubtypeOf

      static TypeDef.Wildcard wildcardSubtypeOf(TypeDef upperBound)
    • wildcardSupertypeOf

      static TypeDef.Wildcard wildcardSupertypeOf(TypeDef lowerBound)
    • array

      static TypeDef.Array array(TypeDef componentType)
    • array

      static TypeDef.Array array(TypeDef componentType, int dimensions)
    • of

      static TypeDef of(Class<?> type)
      Creates a new type.
      Parameters:
      type - The type
      Returns:
      a new type definition
    • parameterized

      static ClassTypeDef parameterized(Class<?> type, Class<?>... genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • parameterized

      static ClassTypeDef parameterized(Class<?> type, TypeDef... genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • parameterized

      static ClassTypeDef parameterized(ClassTypeDef type, TypeDef... genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • parameterized

      static ClassTypeDef parameterized(ClassTypeDef type, Class<?>... genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • parameterized

      static ClassTypeDef parameterized(ClassTypeDef type, List<TypeDef> genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • variable

      static TypeDef.TypeVariable variable(String name, List<TypeDef> bounds)
      Creates a new type variable.
      Parameters:
      name - The type
      bounds - The bounds
      Returns:
      a new type variable
    • variable

      static TypeDef.TypeVariable variable(String name, TypeDef... bounds)
      Creates a new type variable.
      Parameters:
      name - The type
      bounds - The bounds
      Returns:
      a new type variable
    • of

      static TypeDef of(io.micronaut.inject.ast.TypedElement typedElement)
      Creates a new type.
      Parameters:
      typedElement - The typed element
      Returns:
      a new type definition
    • erasure

      static TypeDef erasure(io.micronaut.inject.ast.TypedElement typedElement)
      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

      default TypeDef makeNullable()
      Returns:
      A new nullable type