Delta Stream
A stream of delta items, each of which is either an {@link com.sap.cloud.mobile.kotlin.odata.EntityValue} or a {@link com.sap.cloud.mobile.kotlin.odata.ChangedLink}. While processing a stream, a delta link may be encountered, but it will not be immediately available to the caller. The {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#deltaLink DeltaStream.deltaLink} can be obtained only after the stream is closed.
Example
let deltaStream = ...;
while (deltaStream.next())
{
if (deltaStream.hasEntity())
{
let entity = deltaStream.getEntity();
// Process entity value.
}
else
{
let link = deltaStream.getLink();
// Process changed link.
}
}
deltaStream.close();
var deltaLink = deltaStream.deltaLink;
// Save delta link for later use.
Functions
Close this stream and release all associated resources, checking first that the end of stream has been reached. Can safely be called even if the stream was previously closed. If a delta link was encountered before the stream was closed, it will be available via the {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#deltaLink DeltaStream.deltaLink} property only after the stream is closed. If a next link was encountered before the stream was closed, it will be available via the {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#nextLink DeltaStream.nextLink} property only after the stream is closed.
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#abort() DeltaStream.abort}.
Return (nullable) the current delta item (an {@link com.sap.cloud.mobile.kotlin.odata.EntityValue} or {@link com.sap.cloud.mobile.kotlin.odata.ChangedLink}), or null if there is no current delta item.
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#hasCurrent() DeltaStream.hasCurrent}.
Return the current entity value.
- Throws:
-
{@link com.sap.cloud.mobile.kotlin.odata.core.UsageException} if there no current delta item or if the current delta item is a changed link.
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getCurrent() DeltaStream.getCurrent}.
Return the current changed link.
- Throws:
-
{@link com.sap.cloud.mobile.kotlin.odata.core.UsageException} if there is no current delta item or if the current delta item is an entity value.
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getCurrent() DeltaStream.getCurrent}.
Return true if the if the stream has a current delta item (the most recent call to {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#next() DeltaStream.next} returned true and {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#close() DeltaStream.close} has not been called)).
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getCurrent() DeltaStream.getCurrent}.
If this stream has not been {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#close() DeltaStream.close} and has a next delta item, then advance to the next delta item and return true. Otherwise return false.
- See Also:
-
{@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#hasCurrent() DeltaStream.hasCurrent}, {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#hasEntity() DeltaStream.hasEntity}, {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#hasLink() DeltaStream.hasLink}, {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getCurrent() DeltaStream.getCurrent}, {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getEntity() DeltaStream.getEntity}, {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#getLink() DeltaStream.getLink}.
Convert this data value to a string. If the {@link com.sap.cloud.mobile.kotlin.odata.DeltaStream#dataType DeltaStream.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).