Package io.micronaut.data.model
Enum Class DataType
- All Implemented Interfaces:
Serializable
,Comparable<DataType>
,Constable
Enum of basic data types allowing to compile time computation which can then subsequently be used at runtime for fast
switching.
- Since:
- 1.0.0
- Author:
- graemerocher
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA big decimal such asBigDecimal
.A boolean value.A boolean array.A byte.A byte array.A character.A character array.ADouble
value.A double array.A class annotated withMappedEntity
.AFloat
value.A long array.AInteger
value.An integer array.A JSON type.ALong
value.A long array.An object of an indeterminate type.AShort
value.A short array.AString
value.A string array.ATime
value.The UUID type. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataType
Obtains the data type for the given type.boolean
isArray()
Is an array type.boolean
Gets an indicator telling whether data type is numeric.static DataType
Returns the enum constant of this class with the specified name.static DataType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIGDECIMAL
A big decimal such asBigDecimal
. -
BOOLEAN
A boolean value. -
BYTE
A byte. -
BYTE_ARRAY
A byte array. Often stored as binary. -
CHARACTER
A character. -
DATE
-
TIMESTAMP
-
TIME
ATime
value. -
DOUBLE
ADouble
value. -
FLOAT
AFloat
value. -
INTEGER
AInteger
value. -
LONG
ALong
value. -
SHORT
AShort
value. -
STRING
AString
value. -
OBJECT
An object of an indeterminate type. -
ENTITY
A class annotated withMappedEntity
. -
JSON
A JSON type. -
UUID
The UUID type. -
STRING_ARRAY
A string array. -
SHORT_ARRAY
A short array. -
INTEGER_ARRAY
An integer array. -
LONG_ARRAY
A long array. -
FLOAT_ARRAY
A long array. -
DOUBLE_ARRAY
A double array. -
CHARACTER_ARRAY
A character array. -
BOOLEAN_ARRAY
A boolean array.
-
-
Field Details
-
EMPTY_DATA_TYPE_ARRAY
Empty array of data types.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
isArray
public boolean isArray()Is an array type.- Returns:
- true if an array type
-
forType
Obtains the data type for the given type.- Parameters:
type
- The type- Returns:
- The data type
-
isNumeric
public boolean isNumeric()Gets an indicator telling whether data type is numeric.- Returns:
- true if data type is numeric
-