public abstract class DataValue
extends java.lang.Object
Abstract base class for wrapper classes that wrap basic data values as objects, as well as calendar values, geography values, geometry values, ComplexValue
, EntityValue
and ListBase
.
StringValue
, BinaryValue
, BooleanValue
, CharValue
, ByteValue
, ShortValue
, IntValue
, LongValue
, IntegerValue
, DecimalValue
, FloatValue
, DoubleValue
, UnsignedByte
, UnsignedShort
, EnumValue
, GuidValue
, LocalDate
, LocalTime
, LocalDateTime
, GlobalDateTime
, DayTimeDuration
, YearMonthDuration
, GeographyValue
, GeometryValue
.
Constructor and Description |
---|
DataValue() |
Modifier and Type | Method and Description |
---|---|
static DataValue |
cloneMutable(DataValue value)
Return (nullable) A clone of
value if it is mutable, or value if it is immutable. |
boolean |
equals(java.lang.Object value)
Return
true if this object is equal to value . |
abstract DataType |
getDataType()
Return data type of the wrapped value.
|
int |
getTypeCode()
Return data type code of the wrapped value, equivalent to
dataType.code . |
int |
hashCode()
Hash this data value to a number.
|
abstract java.lang.String |
toString()
Convert this data value to a string.
|
public static final DataValue undefined
public static DataValue cloneMutable(DataValue value)
Return (nullable) A clone of value
if it is mutable, or value
if it is immutable.
value
- (nullable) Value to be cloned.value
if it is mutable, or value
if it is immutable.public boolean equals(java.lang.Object value)
Return true
if this object is equal to value
.
equals
in class java.lang.Object
value
- (nullable) The value to compare with.true
if this object is equal to value
.public abstract DataType getDataType()
Return data type of the wrapped value.
public int getTypeCode()
Return data type code of the wrapped value, equivalent to dataType.code
.
dataType.code
.public int hashCode()
Hash this data value to a number.
hashCode
in class java.lang.Object
int
.public abstract java.lang.String toString()
Convert this data value to a string.
If the DataValue.dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used.
JSON format is used for structured values (arrays and objects).
toString
in class java.lang.Object