com.j256.ormlite.field
Enum DataType

java.lang.Object
  extended by java.lang.Enum<DataType>
      extended by com.j256.ormlite.field.DataType
All Implemented Interfaces:
Serializable, Comparable<DataType>

public enum DataType
extends Enum<DataType>

Data type enumeration that corresponds to a DataPersister.

Author:
graywatson

Enum Constant Summary
BIG_DECIMAL
          Persists the BigDecimal Java class as a String.
BIG_DECIMAL_NUMERIC
          Persists the BigDecimal Java class as a SQL NUMERIC.
BIG_INTEGER
          Persists the BigInteger Java class.
BOOLEAN
          Persists the boolean Java primitive.
BOOLEAN_OBJ
          Persists the Boolean Java class.
BYTE
          Persists the byte primitive.
BYTE_ARRAY
          Persists the byte[] array type.
BYTE_OBJ
          Persists the Byte Java class.
CHAR
          Persists the char primitive.
CHAR_OBJ
          Persists the char primitive.
DATE
          Persists the Date Java class.
DATE_LONG
          Persists the Date Java class as long milliseconds since epoch.
DATE_STRING
          Persists the Date Java class as a string of a format.
DOUBLE
          Persists the double primitive.
DOUBLE_OBJ
          Persists the Double Java class.
ENUM_INTEGER
          Persists an Enum Java class as its ordinal integer value.
ENUM_STRING
          Persists an Enum Java class as its string value.
FLOAT
          Persists the float primitive.
FLOAT_OBJ
          Persists the Float Java class.
INTEGER
          Persists the int primitive.
INTEGER_OBJ
          Persists the Integer Java class.
LONG
          Persists the long primitive.
LONG_OBJ
          Persists the Long Java class.
LONG_STRING
          Persists the String Java class.
SERIALIZABLE
          Persists an unknown Java Object that is serializable.
SHORT
          Persists the short primitive.
SHORT_OBJ
          Persists the Short Java class.
STRING
          Persists the String Java class.
STRING_BYTES
          Persists the String Java class.
UNKNOWN
          Marker for fields that are unknown.
UUID
          Persists the UUID Java class.
 
Method Summary
 DataPersister getDataPersister()
           
static DataType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DataType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRING

public static final DataType STRING
Persists the String Java class.


LONG_STRING

public static final DataType LONG_STRING
Persists the String Java class.


STRING_BYTES

public static final DataType STRING_BYTES
Persists the String Java class.


BOOLEAN

public static final DataType BOOLEAN
Persists the boolean Java primitive.


BOOLEAN_OBJ

public static final DataType BOOLEAN_OBJ
Persists the Boolean Java class.


DATE

public static final DataType DATE
Persists the Date Java class.

NOTE: This is not the same as the Date class.


DATE_LONG

public static final DataType DATE_LONG
Persists the Date Java class as long milliseconds since epoch.

NOTE: This is not the same as the Date class.


DATE_STRING

public static final DataType DATE_STRING
Persists the Date Java class as a string of a format.

NOTE: This is not the same as the Date class.

WARNING: Because of SimpleDateFormat not being reentrant, this has to do some synchronization with every data in/out unfortunately.


CHAR

public static final DataType CHAR
Persists the char primitive.


CHAR_OBJ

public static final DataType CHAR_OBJ
Persists the char primitive.


BYTE

public static final DataType BYTE
Persists the byte primitive.


BYTE_ARRAY

public static final DataType BYTE_ARRAY
Persists the byte[] array type.


BYTE_OBJ

public static final DataType BYTE_OBJ
Persists the Byte Java class.


SHORT

public static final DataType SHORT
Persists the short primitive.


SHORT_OBJ

public static final DataType SHORT_OBJ
Persists the Short Java class.


INTEGER

public static final DataType INTEGER
Persists the int primitive.


INTEGER_OBJ

public static final DataType INTEGER_OBJ
Persists the Integer Java class.


LONG

public static final DataType LONG
Persists the long primitive.


LONG_OBJ

public static final DataType LONG_OBJ
Persists the Long Java class.


FLOAT

public static final DataType FLOAT
Persists the float primitive.


FLOAT_OBJ

public static final DataType FLOAT_OBJ
Persists the Float Java class.


DOUBLE

public static final DataType DOUBLE
Persists the double primitive.


DOUBLE_OBJ

public static final DataType DOUBLE_OBJ
Persists the Double Java class.


SERIALIZABLE

public static final DataType SERIALIZABLE
Persists an unknown Java Object that is serializable.


ENUM_STRING

public static final DataType ENUM_STRING
Persists an Enum Java class as its string value. You can also specify the ENUM_INTEGER as the type.


ENUM_INTEGER

public static final DataType ENUM_INTEGER
Persists an Enum Java class as its ordinal integer value. You can also specify the ENUM_STRING as the type.


UUID

public static final DataType UUID
Persists the UUID Java class.


BIG_INTEGER

public static final DataType BIG_INTEGER
Persists the BigInteger Java class.


BIG_DECIMAL

public static final DataType BIG_DECIMAL
Persists the BigDecimal Java class as a String.


BIG_DECIMAL_NUMERIC

public static final DataType BIG_DECIMAL_NUMERIC
Persists the BigDecimal Java class as a SQL NUMERIC.


UNKNOWN

public static final DataType UNKNOWN
Marker for fields that are unknown.

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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getDataPersister

public DataPersister getDataPersister()


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.