Enum DataType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DataType>

    public enum DataType
    extends java.lang.Enum<DataType>
    Enum of basic data types allowing compile time computation which can then subsequently be used at runtime for fast switching.
    Since:
    1.0.0
    See Also:
    PersistentProperty.getDataType()
    • Enum Constant Detail

      • 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.
      • 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.
      • 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 Detail

      • EMPTY_DATA_TYPE_ARRAY

        public static final DataType[] EMPTY_DATA_TYPE_ARRAY
        Empty array of data types.
    • Method Detail

      • values

        public static DataType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DataType c : DataType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DataType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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
                                       java.lang.Class<?> type)
        Obtains the data type for the given type.
        Parameters:
        type - The type
        Returns:
        The data type