Interface TypeDef

All Known Subinterfaces:
ClassTypeDef
All Known Implementing Classes:
ClassTypeDef.ClassDefType, ClassTypeDef.ClassElementType, ClassTypeDef.ClassName, ClassTypeDef.JavaClass, ClassTypeDef.Parameterized, 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 VOID
    • OBJECT

      static final TypeDef OBJECT
    • BOOLEAN

      static final TypeDef BOOLEAN
    • THIS

      static final TypeDef 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.
  • Method Details

    • instantiateArray

      default ExpressionDef instantiateArray(int length)
      Instantiate an array of this class.
      Parameters:
      length - The length of the array
      Returns:
      The instantiate expression
      Since:
      1.2
    • instantiateArray

      default ExpressionDef instantiateArray(List<ExpressionDef> expressions)
      Instantiate an array of this class.
      Parameters:
      expressions - The items expressions
      Returns:
      The instantiate expression
      Since:
      1.2
    • instantiateArray

      default ExpressionDef instantiateArray(ExpressionDef... expressions)
      Instantiate an array of this class.
      Parameters:
      expressions - The items expressions
      Returns:
      The instantiate expression
      Since:
      1.2
    • primitive

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

      static TypeDef 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, List<TypeDef> genericParameters)
      Creates a new type with generic parameters.
      Parameters:
      type - The type
      genericParameters - The parameters
      Returns:
      a new type definition
    • of

      static TypeDef of(io.micronaut.inject.ast.ClassElement classElement)
      Creates a new type.
      Parameters:
      classElement - The class element
      Returns:
      a new type definition
    • isNullable

      default boolean isNullable()
      Returns:
      Is nullable type
    • makeNullable

      default TypeDef makeNullable()
      Returns:
      A new nullable type