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 Summary
Enum 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 Summary
Fields Modifier and Type Field Description static DataType[]EMPTY_DATA_TYPE_ARRAYEmpty array of data types.
-
Method Summary
All 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
-
BIGDECIMAL
public static final DataType BIGDECIMAL
A big decimal such asBigDecimal.
-
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 asDateorLocalDate.
-
TIMESTAMP
public static final DataType TIMESTAMP
A timestamp such asTimestamporInstant.
-
DOUBLE
public static final DataType DOUBLE
ADoublevalue.
-
FLOAT
public static final DataType FLOAT
AFloatvalue.
-
INTEGER
public static final DataType INTEGER
AIntegervalue.
-
LONG
public static final DataType LONG
ALongvalue.
-
SHORT
public static final DataType SHORT
AShortvalue.
-
STRING
public static final DataType STRING
AStringvalue.
-
OBJECT
public static final DataType OBJECT
An object of an indeterminate type.
-
ENTITY
public static final DataType ENTITY
A class annotated withMappedEntity.
-
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 namejava.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
-
-