public static enum Schema.DataType extends java.lang.Enum<Schema.DataType>
No data types other than the money types support implicit data conversions, except those that are performed automatically by Java. For example populating an integer into a long field will work because Java automatically upcasts the data. On the other hand populating a long field with an integer will require an explicit cast in the user code.
The Money data types support implicit conversions as long as it results in no loss of precision or range. So it is possible to populate a MONEY03 with a Money object with precision 5. The SDK will perform the necessary adjustments internally. If that results in loss of precision or range an exception will be thrown.
| Enum Constant and Description |
|---|
BIGDATETIME
64 bit signed # of *micro*seconds since unix epoch.
|
BINARY
raw buffer containing binary data
|
BOOLEAN
Boolean
|
DATE
Unsigned integer representing seconds since the epoch.
|
DOUBLE
64 bit floating point number corresponding to FLOAT in the model
|
INTEGER
32 bit integer
|
INTERVAL
64-bit integer representing interval value in microseconds
|
LONG
64 bit integer
|
MONEY
Legacy money type.
|
MONEY01
Money type - prec 1 (range -922,337,203,685,477,580.8 through +922,337,203,685,477,580.7)
|
MONEY02
Money type - prec 2 (range -92,233,720,368,547,758.08 through +92,233,720,368,547,758.07)
|
MONEY03
Money type - prec 3 (range -9,223,372,036,854,775.808 through +9,223,372,036,854,775.807)
|
MONEY04
Money type - prec 4 (range -922,337,203,685,477.5808 through +922,337,203,685,477.5807 )
|
MONEY05
Money type - prec 5 (range -92,233,720,368,547.75808 through +92,233,720,368,547.75807 )
|
MONEY06
Money type - prec 6 (range -9,223,372,036,854.775808 through +9,223,372,036,854.775807 )
|
MONEY07
Money type - prec 7 (range -922,337,203,685.4775808 through +922,337,203,685.4775807 )
|
MONEY08
Money type - prec 8 (range -92,233,720,368.54775808 through +92,233,720,368.54775807 )
|
MONEY09
Money type - prec 9 (range -9,223,372,036.854775808 through +9,223,372,036.854775807 )
|
MONEY10
Money type - prec 10 (range -922,337,203.6854775808 through +922,337,203.6854775807 )
|
MONEY11
Money type - prec 11 (range -92,233,720.36854775808 through +92,233,720.36854775807 )
|
MONEY12
Money type - prec 12 (range -9,223,372.036854775808 through +9,223,372.036854775807 )
|
MONEY13
Money type - prec 13 (range -922,337.2036854775808 through +922,337.2036854775807 )
|
MONEY14
Money type - prec 14 (range -92,233.72036854775808 through +92,233.72036854775807 )
|
MONEY15
Money type - prec 15 (range -9,223.372036854775808 through +9,223.372036854775807 )
|
STRING
UTF-8 string
|
TIMESTAMP
64 bit signed # of milliseconds since unix epoch.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatDate(java.util.Date date)
Utility method to format a Date object.
|
static java.lang.String |
formatTimestamp(java.util.Date date)
Utility method to format a data object into the standard representation of a ESP timestamp data
type.
|
int |
getPrecision()
If the datatype is a Money datatype returns the precision.
|
static byte[] |
hexDecodeBinary(java.lang.String binaryData) |
static java.lang.String |
hexEncodeBinary(byte[] binaryData) |
boolean |
isMoneyType()
Returns true if the datatype is one of the money datatypes supported by ESP.
|
static boolean |
parseBoolean(java.lang.String booleanString)
For strings 'true', 'yes', 'on', 't', 'y', '1' in any case returns true.
|
static java.util.Date |
parseDate(java.lang.String date)
Utility method to parse a string in the standard ESP format for a into a Date object
|
static Schema.DataType |
parseInt(int type) |
static java.util.Date |
parseTimestamp(java.lang.String timestamp)
Utility method to parse a string in the standard ESP format for a timestamp into a Date object.
|
static Schema.DataType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Schema.DataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Schema.DataType BOOLEAN
public static final Schema.DataType INTEGER
public static final Schema.DataType LONG
public static final Schema.DataType DOUBLE
public static final Schema.DataType MONEY
public static final Schema.DataType MONEY01
public static final Schema.DataType MONEY02
public static final Schema.DataType MONEY03
public static final Schema.DataType MONEY04
public static final Schema.DataType MONEY05
public static final Schema.DataType MONEY06
public static final Schema.DataType MONEY07
public static final Schema.DataType MONEY08
public static final Schema.DataType MONEY09
public static final Schema.DataType MONEY10
public static final Schema.DataType MONEY11
public static final Schema.DataType MONEY12
public static final Schema.DataType MONEY13
public static final Schema.DataType MONEY14
public static final Schema.DataType MONEY15
public static final Schema.DataType STRING
public static final Schema.DataType DATE
public static final Schema.DataType TIMESTAMP
public static final Schema.DataType BIGDATETIME
public static final Schema.DataType INTERVAL
public static final Schema.DataType BINARY
public static Schema.DataType[] values()
for (Schema.DataType c : Schema.DataType.values()) System.out.println(c);
public static Schema.DataType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant
with the specified namejava.lang.NullPointerException - if the argument is nullpublic static final Schema.DataType parseInt(int type)
public boolean isMoneyType()
public int getPrecision()
For non money types including legacy MONEY returns -1.
public static final java.util.Date parseDate(java.lang.String date)
throws java.text.ParseException
date - java.text.ParseExceptionpublic static final java.lang.String formatDate(java.util.Date date)
date - public static java.util.Date parseTimestamp(java.lang.String timestamp)
throws java.text.ParseException
java.text.ParseExceptionpublic static final java.lang.String formatTimestamp(java.util.Date date)
date - public static final java.lang.String hexEncodeBinary(byte[] binaryData)
public static final byte[] hexDecodeBinary(java.lang.String binaryData)
public static final boolean parseBoolean(java.lang.String booleanString)
booleanString -