Enum Class DataType

java.lang.Object
java.lang.Enum<DataType>
io.micronaut.data.model.DataType
All Implemented Interfaces:
Serializable, Comparable<DataType>, Constable

public enum DataType extends Enum<DataType>
Enum of basic data types allowing to compile time computation which can then subsequently be used at runtime for fast switching.
Since:
1.0.0
Author:
graemerocher
See Also:
  • Enum Constant Details

    • BIGDECIMAL

      public static final DataType BIGDECIMAL
      A big decimal such as BigDecimal.
    • BOOLEAN

      public static final DataType BOOLEAN
      A boolean value.
    • BYTE

      public static final DataType BYTE
      A byte.
    • BYTE_ARRAY

      public static final DataType BYTE_ARRAY
      A byte array. Often stored as binary.
    • CHARACTER

      public static final DataType CHARACTER
      A character.
    • DATE

      public static final DataType DATE
      A date such as Date or LocalDate.
    • TIMESTAMP

      public static final DataType TIMESTAMP
      A timestamp such as Timestamp or Instant.
    • TIME

      public static final DataType TIME
      A Time value.
    • DOUBLE

      public static final DataType DOUBLE
      A Double value.
    • FLOAT

      public static final DataType FLOAT
      A Float value.
    • INTEGER

      public static final DataType INTEGER
      A Integer value.
    • LONG

      public static final DataType LONG
      A Long value.
    • SHORT

      public static final DataType SHORT
      A Short value.
    • STRING

      public static final DataType STRING
      A String value.
    • OBJECT

      public static final DataType OBJECT
      An object of an indeterminate type.
    • ENTITY

      public static final DataType ENTITY
      A class annotated with MappedEntity.
    • JSON

      public static final DataType JSON
      A JSON type.
    • UUID

      public static final DataType UUID
      The UUID type.
    • STRING_ARRAY

      public static final DataType STRING_ARRAY
      A string array.
    • SHORT_ARRAY

      public static final DataType SHORT_ARRAY
      A short array.
    • INTEGER_ARRAY

      public static final DataType INTEGER_ARRAY
      An integer array.
    • LONG_ARRAY

      public static final DataType LONG_ARRAY
      A long array.
    • FLOAT_ARRAY

      public static final DataType FLOAT_ARRAY
      A long array.
    • DOUBLE_ARRAY

      public static final DataType DOUBLE_ARRAY
      A double array.
    • CHARACTER_ARRAY

      public static final DataType CHARACTER_ARRAY
      A character array.
    • BOOLEAN_ARRAY

      public static final DataType BOOLEAN_ARRAY
      A boolean array.
  • Field Details

    • EMPTY_DATA_TYPE_ARRAY

      @Deprecated(forRemoval=true, since="4.9") public static final DataType[] EMPTY_DATA_TYPE_ARRAY
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not needed
      Empty array of data types.
  • Method Details

    • values

      public static DataType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DataType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isArray

      public boolean isArray()
      Is an array type.
      Returns:
      true if an array type
    • forType

      public static DataType forType(@NonNull @NonNull Class<?> type)
      Obtains the data type for the given type.
      Parameters:
      type - The type
      Returns:
      The data type
    • isNumeric

      public boolean isNumeric()
      Gets an indicator telling whether data type is numeric.
      Returns:
      true if data type is numeric