Package com.iizix

Enum Class Value.Type

All Implemented Interfaces:
Serializable, Comparable<Value.Type>, Constable
Enclosing class:
Value

public static enum Value.Type extends Enum<Value.Type>
The enumeration of Types.
  • Enum Constant Details

    • 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 Details

    • 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 Details

    • values

      public static Value.Type[] 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

      public static Value.Type valueOf(String name)
      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 name
      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 null or default Value of the specified type depending on the isNullAllowed 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

      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).