Package io.micronaut.data.model
Enum DataType
- java.lang.Object
- 
- java.lang.Enum<DataType>
- 
- io.micronaut.data.model.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
- Author:
- graemerocher
- See Also:
- PersistentProperty.getDataType()
 
- 
- 
Enum Constant SummaryEnum Constants Enum Constant Description BIGDECIMALA big decimal such asBigDecimal.BOOLEANA boolean value.BOOLEAN_ARRAYA boolean array.BYTEA byte.BYTE_ARRAYA byte array.CHARACTERA character.CHARACTER_ARRAYA character array.DATEA date such asDateorLocalDate.DOUBLEADoublevalue.DOUBLE_ARRAYA double array.ENTITYA class annotated withMappedEntity.FLOATAFloatvalue.FLOAT_ARRAYA long array.INTEGERAIntegervalue.INTEGER_ARRAYAn integer array.JSONA JSON type.LONGALongvalue.LONG_ARRAYA long array.OBJECTAn object of an indeterminate type.SHORTAShortvalue.SHORT_ARRAYA short array.STRINGAStringvalue.STRING_ARRAYA string array.TIMESTAMPA timestamp such asTimestamporInstant.UUIDThe UUID type.
 - 
Field SummaryFields Modifier and Type Field Description static DataType[]EMPTY_DATA_TYPE_ARRAYEmpty array of data types.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataTypeforType(java.lang.Class<?> type)Obtains the data type for the given type.booleanisArray()Is an array type.static DataTypevalueOf(java.lang.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.
 
- 
- 
- 
Enum Constant Detail- 
BIGDECIMALpublic static final DataType BIGDECIMAL A big decimal such asBigDecimal.
 - 
BOOLEANpublic static final DataType BOOLEAN A boolean value.
 - 
BYTEpublic static final DataType BYTE A byte.
 - 
BYTE_ARRAYpublic static final DataType BYTE_ARRAY A byte array. Often stored as binary.
 - 
CHARACTERpublic static final DataType CHARACTER A character.
 - 
DATEpublic static final DataType DATE A date such asDateorLocalDate.
 - 
TIMESTAMPpublic static final DataType TIMESTAMP A timestamp such asTimestamporInstant.
 - 
DOUBLEpublic static final DataType DOUBLE ADoublevalue.
 - 
FLOATpublic static final DataType FLOAT AFloatvalue.
 - 
INTEGERpublic static final DataType INTEGER AIntegervalue.
 - 
LONGpublic static final DataType LONG ALongvalue.
 - 
SHORTpublic static final DataType SHORT AShortvalue.
 - 
STRINGpublic static final DataType STRING AStringvalue.
 - 
OBJECTpublic static final DataType OBJECT An object of an indeterminate type.
 - 
ENTITYpublic static final DataType ENTITY A class annotated withMappedEntity.
 - 
JSONpublic static final DataType JSON A JSON type.
 - 
UUIDpublic static final DataType UUID The UUID type.
 - 
STRING_ARRAYpublic static final DataType STRING_ARRAY A string array.
 - 
SHORT_ARRAYpublic static final DataType SHORT_ARRAY A short array.
 - 
INTEGER_ARRAYpublic static final DataType INTEGER_ARRAY An integer array.
 - 
LONG_ARRAYpublic static final DataType LONG_ARRAY A long array.
 - 
FLOAT_ARRAYpublic static final DataType FLOAT_ARRAY A long array.
 - 
DOUBLE_ARRAYpublic static final DataType DOUBLE_ARRAY A double array.
 - 
CHARACTER_ARRAYpublic static final DataType CHARACTER_ARRAY A character array.
 - 
BOOLEAN_ARRAYpublic static final DataType BOOLEAN_ARRAY A boolean array.
 
- 
 - 
Field Detail- 
EMPTY_DATA_TYPE_ARRAYpublic static final DataType[] EMPTY_DATA_TYPE_ARRAY Empty array of data types.
 
- 
 - 
Method Detail- 
valuespublic 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
 
 - 
valueOfpublic 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
 
 - 
isArraypublic boolean isArray() Is an array type.- Returns:
- true if an array type
 
 - 
forTypepublic static DataType forType(@NonNull java.lang.Class<?> type) Obtains the data type for the given type.- Parameters:
- type- The type
- Returns:
- The data type
 
 
- 
 
-