StructureBase

abstract class StructureBase : DataValue

Common base class for {@link com.sap.cloud.mobile.kotlin.odata.ComplexValue} and {@link com.sap.cloud.mobile.kotlin.odata.EntityValue}.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val isProxy: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Return a copy of this structure (only structural properties are copied).

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.ComplexValue#copyComplex() ComplexValue.copyComplex}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#copyEntity() EntityValue.copyEntity}.

Link copied to clipboard

Get the value of a specified property path.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.UndefinedException} if the property value was not previously set.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.StructureBase#hasDataValue(com.sap.cloud.mobile.kotlin.odata.Property) StructureBase.hasDataValue}.

Link copied to clipboard

Return (nullable) The value of a dynamic property, or null if no such property exists.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dynamicProperties StructureBase.dynamicProperties}.

Link copied to clipboard

Get the next-link of a specified collection-typed property path.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.StructureBase#hasNextLink(com.sap.cloud.mobile.kotlin.odata.Property) StructureBase.hasNextLink}.

Link copied to clipboard

Get the optional value of a specified property path.

Link copied to clipboard

Get the required value of a specified property path.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.UndefinedException} if the property value was not previously set (or is null), {@link com.sap.cloud.mobile.kotlin.odata.core.CastException} if the property value is null.

Link copied to clipboard
open fun getSearchWords(select: PropertyList?, tabs: Boolean): StringList

Return the candidate search words in this structure, for use by {@link com.sap.cloud.mobile.kotlin.odata.SearchExpression#matches(com.sap.cloud.mobile.kotlin.odata.StringList) SearchExpression.matches}. Search words are obtained from string-typed properties using {@link com.sap.cloud.mobile.kotlin.odata.SearchExpression#wordsInText(kotlin.String) SearchExpression.wordsInText}.

Link copied to clipboard

Get the stream link for a specified stream property.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.UsageException} if the property is not a stream property.

Link copied to clipboard

Return true if this structure has one or more changed properties. Seee {@link com.sap.cloud.mobile.kotlin.odata.ComplexValue#oldComplex ComplexValue.oldComplex}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#oldEntity EntityValue.oldEntity}.

Link copied to clipboard

Return true if this structure has the specified data type (or a subtype).

Link copied to clipboard
fun hasDataValue(property: Property): Boolean

Return true if this structure contains an explicitly set value for the specified property (including null, if {@link com.sap.cloud.mobile.kotlin.odata.Property#isNullable Property.isNullable}).

Link copied to clipboard
fun hasNextLink(property: Property): Boolean

Return true if this structure contains a next-link for the specified collection-typed property.

Link copied to clipboard
open fun isNewOrChanged(property: Property): Boolean

Return true if the value of property property is new or changed.

Link copied to clipboard

Resolve {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dataPath StructureBase.dataPath} for this structure's child structures.

Link copied to clipboard
open fun resolveDataPath()

Resolve {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dataPath StructureBase.dataPath} for this structure. It might still be null afterwards if it cannot be resolved.

Link copied to clipboard
open fun resolveDataPaths()

Resolve {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dataPath StructureBase.dataPath} for this structure and its child structures.

Link copied to clipboard
fun setDataValue(property: Property, value: DataValue?)

Set the value of a specified property.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.CastException} if the property value does not have the expected type.

Link copied to clipboard
fun setDefaultValues(nestedComplex: Boolean)
fun setDefaultValues(nestedComplex: Boolean, nestedEntity: Boolean)
fun setDefaultValues(nestedComplex: Boolean, nestedEntity: Boolean, defaultOptional: Boolean)
fun setDefaultValues(nestedComplex: Boolean, nestedEntity: Boolean, defaultOptional: Boolean, defaultRequired: Boolean)
fun setDefaultValues(nestedComplex: Boolean, nestedEntity: Boolean, defaultOptional: Boolean, defaultRequired: Boolean, skipConstraints: Boolean)

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.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.StructureBase#hasDataValue(com.sap.cloud.mobile.kotlin.odata.Property) StructureBase.hasDataValue}, {@link com.sap.cloud.mobile.kotlin.odata.Property#defaultValue Property.defaultValue}, {@link com.sap.cloud.mobile.kotlin.odata.StructureType#structuralProperties StructureType.structuralProperties}, {@link com.sap.cloud.mobile.kotlin.odata.StructureType#navigationProperties StructureType.navigationProperties}.

Link copied to clipboard
fun setDynamic(name: String, value: DataValue?)

Add or change the value of a dynamic property.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dynamicProperties StructureBase.dynamicProperties}.

Link copied to clipboard
fun setOptionalValue(property: Property, value: DataValue?)

Set the optional value of a specified property. If a null value is provided and the property does not permit null values ({@link com.sap.cloud.mobile.kotlin.odata.Property#isNullable Property.isNullable} is false), then this is equivalent to calling unsetDataValue, otherwise it is equivalent to calling setDataValue.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.CastException} if the property value does not have the expected type.

Link copied to clipboard
fun setRequiredValue(property: Property, value: DataValue)

Set the required value of a specified property.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.core.CastException} if the property value does not have the expected type.

Link copied to clipboard
fun setUnsafeValue(property: Property, value: DataValue?)

Set the value of a specified property (like {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#setDataValue(com.sap.cloud.mobile.kotlin.odata.Property, com.sap.cloud.mobile.kotlin.odata.DataValue?) StructureBase.setDataValue}), but bypassing the usual validation checks. This may be useful in performance critical code, but note that it will be assumed that:

  • The property belongs to the structure's type.
  • The value has the correct type for the property.
Link copied to clipboard
fun unsetDataValue(property: Property)

Unset the value of a specified property, so that {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#hasDataValue(com.sap.cloud.mobile.kotlin.odata.Property) StructureBase.hasDataValue}(property) will return false.

Link copied to clipboard

Call {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#unsetDataValue(com.sap.cloud.mobile.kotlin.odata.Property) StructureBase.unsetDataValue} for all navigation properties in this structure.

Link copied to clipboard
fun withLock(work: () -> Unit)

Perform some work while holding an instance-level exclusive lock (if this structure is lock-enabled), or without a lock if this structure is not lock-enabled.