Package com.iizix
Enum Class Value.Type
- All Implemented Interfaces:
Serializable
,Comparable<Value.Type>
,Constable
- Enclosing class:
- Value
The enumeration of Types.
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Enum Constant Summary
Enum ConstantDescriptionThe Data Type: BigDecimal.The Data Type: BigInteger.The Data Type: Binary as byte [].The Data Type: T_Boolean as Boolean.The Data Type: Byte.The Data Type: Double.The Data Type: java.time.Duration.The Data Type: Float.The Data Type: Integer.The Data Type: String value.The Data Type: java.time.LocalDate.The Data Type: java.time.LocalDateTime.The Data Type: java.time.LocalTime.The Data Type: Long.The Data Type: java.time.MonthDay.The Data Type: java.time.OffsetDateTime.The Data Type: java.time.OffsetTime.The Data Type: java.time.Period.The Data Type: Short.The Data Type: String value.The Data Type: javax.xml.datatype.Duration.The Data Type: XMLGregorianCalendar using ImmutableXMLGregorianCalendar value class.The Data Type: java.time.Year.The Data Type: java.time.YearMonth.The Data Type: java.time.ZonedDateTime.Field Summary
Modifier and TypeFieldDescriptionfinal Value.Category
The category, null for value-specific category.final Value
The null value for the type.final IValueObject<?>
The interface that creates the default value.Method Summary
Modifier and TypeMethodDescriptionboolean
canConvertTo
(Value.Type dest) Returns if this value can be converted to another value type.Creates a default value.getDefaultValue
(boolean isNullAllowed) Gets a shared instance of anull
or defaultValue
of the specified type depending on theisNullAllowed
flag.int
Gets the default SQL type for this Type.static Value.Type
Returns the enum constant of this class with the specified name.static Value.Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
String
The Data Type: String value.KString
The Data Type: String value.Boolean
The Data Type: T_Boolean as Boolean.Byte
The Data Type: Byte.Short
The Data Type: Short.Integer
The Data Type: Integer.Long
The Data Type: Long.Float
The Data Type: Float.Double
The Data Type: Double.BigInteger
The Data Type: BigInteger.BigDecimal
The Data Type: BigDecimal.LocalTime
The Data Type: java.time.LocalTime.OffsetTime
The Data Type: java.time.OffsetTime.LocalDate
The Data Type: java.time.LocalDate.MonthDay
The Data Type: java.time.MonthDay. No SQL mapping.Year
The Data Type: java.time.Year. No SQL mapping.YearMonth
The Data Type: java.time.YearMonth. No SQL mapping.LocalDateTime
The Data Type: java.time.LocalDateTime.OffsetDateTime
The Data Type: java.time.OffsetDateTime.ZonedDateTime
The Data Type: java.time.ZonedDateTime.XMLGregorianCalendar
The Data Type: XMLGregorianCalendar using ImmutableXMLGregorianCalendar value class.Duration
The Data Type: java.time.Duration. No SQL mapping.Period
The Data Type: java.time.Period. No SQL mapping.XMLDuration
The Data Type: javax.xml.datatype.Duration. No SQL mapping.Binary
The Data Type: Binary as byte [].
Field Details
nullValue
The null value for the type.valueObject
The interface that creates the default value.category
The category, null for value-specific category.
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
createDefault
Creates a default value.- Returns:
- A new default value.
getDefaultValue
Gets a shared instance of anull
or defaultValue
of the specified type depending on theisNullAllowed
flag.- Parameters:
isNullAllowed
- Flag for null allowed.- Returns:
- The default or
null Value
of the value type. - Throws:
IllegalArgumentException
- If type is not valid.
getSQLType
public int getSQLType()Gets the default SQL type for this Type.- Returns:
- The SQL type, or
Types.JAVA_OBJECT
if no JDBC mapping is present.
canConvertTo
Returns if this value can be converted to another value type. Data or precision loss is accepted in this conversion, e.g. losing the decimal part (conversion from Float to Integer) or the time part for (converting date-time to date). Note that String and KString are set to be convertable to all types, but they may fail often, e.g. String converted to Date fails due to wrong format.- Parameters:
dest
- The destination type.- Returns:
- true if it is possible to convert, but if the value conversion succeeds or fails depends on the value itself (e.g. convert Integer 256 to Byte will fail).