public class ComplexValue extends StructureBase
Encapsulates an OData complex value.
Constructor and Description |
---|
ComplexValue()
|
ComplexValue(boolean withDefaults)
|
ComplexValue(boolean withDefaults,
ComplexType type)
Construct a new complex value.
|
Modifier and Type | Method and Description |
---|---|
static ComplexValue |
castOptional(DataValue value)
For internal use only.
|
static ComplexValue |
castRequired(DataValue value)
For internal use only.
|
ComplexValue |
copyComplex()
Return a copy of this complex value (only structural properties are copied).
|
static boolean |
equal(ComplexValue a,
ComplexValue b)
Return
true if two complex values have equal structural properties. |
ComplexType |
getComplexType()
The complex type metadata for this value (
ComplexValue.dataType cast to ComplexType ). |
DataType |
getDataType()
Data type with a
DataType.code of DataType.COMPLEX_VALUE. |
ComplexValue |
getOldComplex()
(nullable) Contains the original values for all structural properties of this complex value.
|
int |
getTypeCode()
Data type code of the wrapped value, equivalent to
dataType.code . |
static ComplexValue |
ofType(ComplexType type)
Construct a new complex value of the specified type.
|
void |
setOldComplex(ComplexValue value)
Contains the original values for all structural properties of this complex value.
|
java.lang.String |
toString()
Convert this data value to a string.
|
getDataValue, getDynamic, getDynamicProperties, getOptionalValue, getRequiredValue, getStreamLink, getStructureType, getValuePath, hasDataType, hasDataValue, isProxy, setDataValue, setDefaultValues, setDefaultValues, setDefaultValues, setDynamic, setDynamicProperties, setOptionalValue, setRequiredValue, setValuePath, unsetDataValue
cloneMutable, equals, hashCode
public ComplexValue()
public ComplexValue(boolean withDefaults)
public ComplexValue(boolean withDefaults, ComplexType type)
Construct a new complex value.
This constructor is intended for use by custom complex value subclasses.
Use ComplexValue.ofType
for regular construction.
type
- (nullable) Complex type. Should not be null
except when called by generated proxy base classes.withDefaults
- Should ComplexValue.setDefaultValues
be called to initialize properties with default values?public static ComplexValue castOptional(DataValue value)
For internal use only.
public static ComplexValue castRequired(DataValue value)
For internal use only.
public ComplexValue copyComplex()
Return a copy of this complex value (only structural properties are copied).
public static boolean equal(ComplexValue a, ComplexValue b)
Return true
if two complex values have equal structural properties.
a
- (nullable) First complex value.b
- (nullable) Second complex value.true
if two complex values have equal structural properties.public ComplexType getComplexType()
The complex type metadata for this value (ComplexValue.dataType
cast to ComplexType
).
public DataType getDataType()
Data type with a DataType.code
of DataType.COMPLEX_VALUE.
getDataType
in class DataValue
public ComplexValue getOldComplex()
(nullable) Contains the original values for all structural properties of this complex value.
Used by DataService.updateEntity
to determine the changed properties for PATCH requests.
public int getTypeCode()
Data type code of the wrapped value, equivalent to dataType.code
.
getTypeCode
in class DataValue
public static ComplexValue ofType(ComplexType type)
Construct a new complex value of the specified type.
type
- Complex type for the new value.public void setOldComplex(ComplexValue value)
Contains the original values for all structural properties of this complex value.
Used by DataService.updateEntity
to determine the changed properties for PATCH requests.
public java.lang.String toString()
Convert this data value to a string.
If the ComplexValue.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).