Package com.iizix
Enum Value.Type
- java.lang.Object
- java.lang.Enum<Value.Type>
- com.iizix.Value.Type
 
 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<Value.Type>
 - Enclosing class:
- Value
 - public static enum Value.Type extends java.lang.Enum<Value.Type> The enumeration of Types.
- Enum Constant Summary- Enum Constants - Enum Constant - Description - BigDecimalThe Data Type: BigDecimal.- BigIntegerThe Data Type: BigInteger.- BinaryThe Data Type: Binary as byte [].- BooleanThe Data Type: T_Boolean as Boolean.- ByteThe Data Type: Byte.- DoubleThe Data Type: Double.- DurationThe Data Type: java.time.Duration.- FloatThe Data Type: Float.- IntegerThe Data Type: Integer.- KStringThe Data Type: String value.- LocalDateThe Data Type: java.time.LocalDate.- LocalDateTimeThe Data Type: java.time.LocalDateTime.- LocalTimeThe Data Type: java.time.LocalTime.- LongThe Data Type: Long.- MonthDayThe Data Type: java.time.MonthDay.- OffsetDateTimeThe Data Type: java.time.OffsetDateTime.- OffsetTimeThe Data Type: java.time.OffsetTime.- PeriodThe Data Type: java.time.Period.- ShortThe Data Type: Short.- StringThe Data Type: String value.- XMLDurationThe Data Type: javax.xml.datatype.Duration.- XMLGregorianCalendarThe Data Type: XMLGregorianCalendar using ImmutableXMLGregorianCalendar value class.- YearThe Data Type: java.time.Year.- YearMonthThe Data Type: java.time.YearMonth.- ZonedDateTimeThe Data Type: java.time.ZonedDateTime.
 - Field Summary- Fields - Modifier and Type - Field - Description - Value.Category- categoryThe category, null for value-specific category.- Value- nullValueThe null value for the type.- IValueObject<?>- valueObjectThe interface that creates the default value.
 - Method Summary- All Methods Static Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - boolean- canConvertTo(Value.Type dest)Returns if this value can be converted to another value type.- Value- createDefault()Creates a default value.- Value- getDefaultValue(boolean isNullAllowed)Gets a shared instance of a- nullor default- Valueof the specified type depending on the- isNullAllowedflag.- int- getSQLType()Gets the default SQL type for this Type.- static Value.Type- valueOf(java.lang.String name)Returns the enum constant of this type with the specified name.- static Value.Type[]- values()Returns an array containing the constants of this enum type, in the order they are declared.
 
- Enum Constant Detail- String- public static final Value.Type String The Data Type: String value.
 - KString- public static final Value.Type KString The Data Type: String value.
 - Boolean- public static final Value.Type Boolean The Data Type: T_Boolean as Boolean.
 - Byte- public static final Value.Type Byte The Data Type: Byte.
 - Short- public static final Value.Type Short The Data Type: Short.
 - Integer- public static final Value.Type Integer The Data Type: Integer.
 - Long- public static final Value.Type Long The Data Type: Long.
 - Float- public static final Value.Type Float The Data Type: Float.
 - Double- public static final Value.Type Double The Data Type: Double.
 - BigInteger- public static final Value.Type BigInteger The Data Type: BigInteger.
 - BigDecimal- public static final Value.Type BigDecimal The Data Type: BigDecimal.
 - LocalTime- public static final Value.Type LocalTime The Data Type: java.time.LocalTime.
 - OffsetTime- public static final Value.Type OffsetTime The Data Type: java.time.OffsetTime.
 - LocalDate- public static final Value.Type LocalDate The Data Type: java.time.LocalDate.
 - MonthDay- public static final Value.Type MonthDay The Data Type: java.time.MonthDay. No SQL mapping.
 - Year- public static final Value.Type Year The Data Type: java.time.Year. No SQL mapping.
 - YearMonth- public static final Value.Type YearMonth The Data Type: java.time.YearMonth. No SQL mapping.
 - LocalDateTime- public static final Value.Type LocalDateTime The Data Type: java.time.LocalDateTime.
 - OffsetDateTime- public static final Value.Type OffsetDateTime The Data Type: java.time.OffsetDateTime.
 - ZonedDateTime- public static final Value.Type ZonedDateTime The Data Type: java.time.ZonedDateTime.
 - XMLGregorianCalendar- public static final Value.Type XMLGregorianCalendar The Data Type: XMLGregorianCalendar using ImmutableXMLGregorianCalendar value class.
 - Duration- public static final Value.Type Duration The Data Type: java.time.Duration. No SQL mapping.
 - Period- public static final Value.Type Period The Data Type: java.time.Period. No SQL mapping.
 - XMLDuration- public static final Value.Type XMLDuration The Data Type: javax.xml.datatype.Duration. No SQL mapping.
 - Binary- public static final Value.Type Binary The Data Type: Binary as byte [].
 
 - Field Detail- nullValue- public final Value nullValue The null value for the type.
 - valueObject- public final IValueObject<?> valueObject The interface that creates the default value.
 - category- public final Value.Category category The category, null for value-specific category.
 
 - Method Detail- values- public static Value.Type[] 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 (Value.Type c : Value.Type.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - valueOf- public static Value.Type 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
 
 - createDefault- public Value createDefault() Creates a default value.- Returns:
- A new default value.
 
 - getDefaultValue- public Value getDefaultValue(boolean isNullAllowed) Gets a shared instance of a- nullor default- Valueof the specified type depending on the- isNullAllowedflag.- Parameters:
- isNullAllowed- Flag for null allowed.
- Returns:
- The default or null Valueof the value type.
- Throws:
- java.lang.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_OBJECTif no JDBC mapping is present.
 
 - canConvertTo- public boolean canConvertTo(Value.Type dest) 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).