Amplication AST Libraries Documentation
    Preparing search index...

    Represents a Java type in the AST. This class handles the generation of all Java types including primitive types, wrapper types, collections, arrays, and custom types.

    Hierarchy (View Summary)

    Index

    Properties

    internalType: InternalType

    The internal type representation

    Methods

    • Writes the type declaration to the writer. This includes handling imports for non-primitive types and formatting generic type parameters.

      Parameters

      • writer: Writer

        The writer to write to

      Returns void

    • Creates a primitive int type.

      Returns Type

      A new Type instance representing int

    • Creates a boxed Integer type.

      Returns Type

      A new Type instance representing Integer

    • Creates a primitive long type.

      Returns Type

      A new Type instance representing long

    • Creates a primitive short type.

      Returns Type

      A new Type instance representing short

    • Creates a primitive byte type.

      Returns Type

      A new Type instance representing byte

    • Creates a primitive float type.

      Returns Type

      A new Type instance representing float

    • Creates a primitive double type.

      Returns Type

      A new Type instance representing double

    • Creates a primitive boolean type.

      Returns Type

      A new Type instance representing boolean

    • Creates a primitive char type.

      Returns Type

      A new Type instance representing char

    • Creates a String type.

      Returns Type

      A new Type instance representing String

    • Creates a void type.

      Returns Type

      A new Type instance representing void

    • Creates a void type (alias for void()).

      Returns Type

      A new Type instance representing void

    • Creates a LocalDate type.

      Returns Type

      A new Type instance representing LocalDate

    • Creates a LocalDateTime type.

      Returns Type

      A new Type instance representing LocalDateTime

    • Creates an Object type.

      Returns Type

      A new Type instance representing Object

    • Creates a List type with the specified value type.

      Parameters

      • value: Type

        The type of elements in the list

      Returns Type

      A new Type instance representing List

    • Creates a Set type with the specified value type.

      Parameters

      • value: Type

        The type of elements in the set

      Returns Type

      A new Type instance representing Set

    • Creates a Map type with the specified key and value types.

      Parameters

      • keyType: Type

        The type of map keys

      • valueType: Type

        The type of map values

      Returns Type

      A new Type instance representing Map<keyType, valueType>

    • Creates an Optional type with the specified value type.

      Parameters

      • value: Type

        The type of the optional value

      Returns Type

      A new Type instance representing Optional

    • Creates a generic reference type.

      Parameters

      Returns Type

      A new Type instance representing the generic reference

    • Creates an array type with the specified component type.

      Parameters

      • componentType: Type

        The type of array elements

      Returns Type

      A new Type instance representing componentType[]

    • Creates a wildcard type (?).

      Returns Type

      A new Type instance representing ?

    • Creates a wildcard type with an upper bound (? extends boundType).

      Parameters

      • boundType: Type

        The upper bound type

      Returns Type

      A new Type instance representing ? extends boundType

    • Creates a wildcard type with a lower bound (? super boundType).

      Parameters

      • boundType: Type

        The lower bound type

      Returns Type

      A new Type instance representing ? super boundType

    • Returns the string representation of the AST node. This method creates a new Writer instance and writes the node's content to it.

      Returns string

      The string representation of the AST node