public abstract class StructureBase extends DataValue
The canonical path of this value relative to the service root URL.
Common base class for ComplexValue and EntityValue.
| Constructor and Description |
|---|
StructureBase() |
| Modifier and Type | Method and Description |
|---|---|
DataValue |
getDataValue(PropertyPath path)
Get the value of a specified property path.
|
DataValue |
getDynamic(java.lang.String name)
Return (nullable) The value of a dynamic property, or
null if no such property exists. |
DataValueMap |
getDynamicProperties()
Return holds dynamic property values, for which metadata is not known in advance.
|
java.lang.String |
getNextLink(PropertyPath path)
Get the next-link of a specified collection-typed property path.
|
DataValue |
getOptionalValue(PropertyPath path)
Get the optional value of a specified property path.
|
DataValue |
getRequiredValue(PropertyPath path)
Get the required value of a specified property path.
|
StreamLink |
getStreamLink(Property property)
Get the stream link for a specified stream property.
|
StructureType |
getStructureType()
Return the complex/entity type metadata for this value (
StructureBase.dataType cast to StructureType). |
java.lang.String |
getValuePath()
Return (nullable) The canonical path of this value relative to the service root URL.
|
boolean |
hasDataType(DataType type)
Return
true if this structure has the specified data type (or a subtype). |
boolean |
hasDataValue(Property property)
Return
true if this structure contains an explicitly set value for the specified property (including null, if Property.isNullable). |
boolean |
hasDynamicProperties()
Return true if the structure has dynamic properties set.
|
boolean |
hasNextLink(Property property)
Return
true if this structure contains a next-link for the specified collection-typed property. |
abstract boolean |
isNewOrChanged(Property property)
Return
true if the value of property property is new or changed. |
boolean |
isNull(Property property)
Return
true if this structure contains an explicitly set null value for the specified property. |
boolean |
isProxy()
Return is this structure an instance of a generated proxy class?
|
void |
setDataValue(Property property,
DataValue value)
Set the value of a specified property.
|
void |
setDefaultValues()
|
void |
setDefaultValues(boolean nestedComplex)
|
void |
setDefaultValues(boolean nestedComplex,
boolean nestedEntity)
|
void |
setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional)
|
void |
setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional,
boolean defaultRequired)
|
void |
setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional,
boolean defaultRequired,
boolean skipConstraints)
Recursively apply default values to any unset properties of this structure.
|
void |
setDynamic(java.lang.String name,
DataValue value)
Add or change the value of a dynamic property.
|
void |
setDynamicProperties(DataValueMap value)
Set holds dynamic property values, for which metadata is not known in advance.
|
void |
setNull(Property property)
Set the value of a specified nullable property to
null. |
void |
setOptionalValue(Property property,
DataValue value)
Set the optional value of a specified property.
|
void |
setRequiredValue(Property property,
DataValue value)
Set the required value of a specified property.
|
void |
setValuePath(java.lang.String value)
Set the canonical path of this value relative to the service root URL.
|
void |
unsetDataValue(Property property)
Unset the value of a specified property, so that
StructureBase.hasDataValue(property) will return false. |
cloneMutable, equals, getDataType, getTypeCode, hashCode, toStringpublic DataValue getDataValue(PropertyPath path)
Get the value of a specified property path.
UndefinedException if the property value was not previously set.
path - The specified property path.DataValue, or `null` if the property value is `null`.public DataValue getDynamic(java.lang.String name)
Return (nullable) The value of a dynamic property, or null if no such property exists.
name - Name of a dynamic property.public DataValueMap getDynamicProperties()
Return holds dynamic property values, for which metadata is not known in advance.
public java.lang.String getNextLink(PropertyPath path)
Get the next-link of a specified collection-typed property path.
path - The specified property path.public DataValue getOptionalValue(PropertyPath path)
Get the optional value of a specified property path.
path - The specified property path.DataValue, or null if the property value is null or if the property value was not previously set.public DataValue getRequiredValue(PropertyPath path)
Get the required value of a specified property path.
UndefinedException if the property value was not previously set (or is null), CastException if the property value is null.
path - The specified property path.DataValue.public StreamLink getStreamLink(Property property)
Get the stream link for a specified stream property.
UsageException if the property is not a stream property.
property - The specified stream property.public StructureType getStructureType()
Return the complex/entity type metadata for this value (StructureBase.dataType cast to StructureType).
StructureBase.dataType cast to StructureType).public java.lang.String getValuePath()
Return (nullable) The canonical path of this value relative to the service root URL. Used internally in URL construction. Should not be set explicitly.
public boolean hasDataType(DataType type)
Return true if this structure has the specified data type (or a subtype).
type - Specified data type.true if this structure has the specified data type (or a subtype).public boolean hasDataValue(Property property)
Return true if this structure contains an explicitly set value for the specified property (including null, if Property.isNullable).
property - The specified property.true if this structure contains an explicitly set value for the specified property (including null, if Property.isNullable).public boolean hasDynamicProperties()
Return true if the structure has dynamic properties set.
public boolean hasNextLink(Property property)
Return true if this structure contains a next-link for the specified collection-typed property.
property - The specified property.true if this structure contains a next-link for the specified collection-typed property.public abstract boolean isNewOrChanged(Property property)
Return true if the value of property property is new or changed.
property - Structural property.public boolean isNull(Property property)
Return true if this structure contains an explicitly set null value for the specified property.
UndefinedException if the property value was not previously set.
property - The specified property.public boolean isProxy()
Return is this structure an instance of a generated proxy class?
public void setDataValue(Property property, DataValue value)
Set the value of a specified property.
CastException if the property value does not have the expected type.
property - The specified property.value - (nullable) The property value (or `null`), using the appropriate subclass of DataValue.public final void setDefaultValues()
public final void setDefaultValues(boolean nestedComplex)
nestedComplex - NestedComplex parameter.public final void setDefaultValues(boolean nestedComplex,
boolean nestedEntity)
nestedComplex - NestedComplex parameter.nestedEntity - NestedEntity parameter.public final void setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional)
nestedComplex - NestedComplex parameter.nestedEntity - NestedEntity parameter.defaultOptional - DefaultOptional parameter.public final void setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional,
boolean defaultRequired)
nestedComplex - NestedComplex parameter.nestedEntity - NestedEntity parameter.defaultOptional - DefaultOptional parameter.defaultRequired - DefaultRequired parameter.public final void setDefaultValues(boolean nestedComplex,
boolean nestedEntity,
boolean defaultOptional,
boolean defaultRequired,
boolean skipConstraints)
Recursively apply default values to any unset properties of this structure.
If a property has a model-defined default value, it will always be applied (since that default value is part of a server's contract with the client, it must always be valid to apply it).
If the property doesn't have a model-defined default value, then null will be used for nullable properties, and false/empty/zero values will be applied otherwise as appropriate. Dates will default to 2000-01-01.
nestedComplex - Apply recursively to complex-typed (structural) properties of this structure? Defaults to true.nestedEntity - Apply recursively to entity-typed (navigation) properties of this structure? Defaults to false.defaultOptional - Apply non-model-defined default values to optional (nullable) properties?defaultRequired - Apply non-model-defined default values to required (non-nullable) properties?skipConstraints - Avoid applying default values to properties which have a database-level default constraint.public void setDynamic(java.lang.String name,
DataValue value)
Add or change the value of a dynamic property.
name - Name of a dynamic property.value - (nullable) Value for the dynamic property.public void setDynamicProperties(DataValueMap value)
Set holds dynamic property values, for which metadata is not known in advance.
value - Holds *dynamic* property values, for which metadata is not known in advance.public void setNull(Property property)
Set the value of a specified nullable property to null.
CastException if the property does not accept null values.
property - The specified property.public void setOptionalValue(Property property, DataValue value)
Set the optional value of a specified property.
If a null value is provided and the property does not permit null values (Property.isNullable is false), then this is equivalent to calling unsetDataValue, otherwise it is equivalent to calling setDataValue.
CastException if the property value does not have the expected type.
property - The specified property.value - (nullable) The property value (or `null`), using the appropriate subclass of DataValue.public void setRequiredValue(Property property, DataValue value)
Set the required value of a specified property.
CastException if the property value does not have the expected type.
property - The specified property.value - The property value, using the appropriate subclass of DataValue.public void setValuePath(java.lang.String value)
Set the canonical path of this value relative to the service root URL. Used internally in URL construction. Should not be set explicitly.
value - The canonical path of this value relative to the service root URL.public void unsetDataValue(Property property)
Unset the value of a specified property, so that StructureBase.hasDataValue(property) will return false.
property - The specified property.