Enum Class DataType

Object
Enum<DataType>
DataType
All Implemented Interfaces:
Serializable, Comparable<DataType>, Constable

public enum DataType extends Enum<DataType>
  • Enum Constant Details

    • STRING

      public static final DataType STRING
    • NUMBER

      public static final DataType NUMBER
    • DATE

      public static final DataType DATE
    • BOOLEAN

      public static final DataType BOOLEAN
    • DATETIME

      public static final DataType DATETIME
    • LOB

      public static final DataType LOB
    • LONG

      public static final DataType LONG
    • UNKNOWN

      public static final DataType UNKNOWN
  • Field Details

  • 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
    • get

      public static DataType get(Object dataType)
    • format

      public Object format(Object value)
    • parse

      public Object parse(Object value)
      Throws:
      IllegalArgumentException - (incl. NumberFormatException) if not parsable to this data type.
    • parse

      public Object parse(Object value, Locale locale)
    • toNumber

      public static Number toNumber(String value, Locale locale)
    • numberToString

      public static String numberToString(Number number, int numberOfDecimals)
    • serialize

      public String serialize(Object value)
    • deserialize

      public Object deserialize(String sValue)
    • isAssignable

      public boolean isAssignable(Object value)
    • isNumeric

      public boolean isNumeric()
    • isTime

      public boolean isTime()
    • toDataType

      public static DataType toDataType(Class<?> clazz)
    • toDataType

      public static DataType toDataType(Object value, DataType preferred)
    • isBoolean

      public static boolean isBoolean(Object value)
      Returns:
      true if the value can be parsed as a boolean
    • isDate

      public static boolean isDate(Object value)
      Returns:
      true if the value can be parsed as a date
    • isDateTime

      public static boolean isDateTime(Object value)
      Returns:
      true if the value can be parsed as a timestamp
    • isNumber

      public static boolean isNumber(Object value)
      Returns:
      true if the value can be parsed as a number
    • isLong

      public static boolean isLong(Object value)
      Returns:
      true if the value can be parsed as a non-decimal number