Webcom Android SDK Public API Reference / com.orange.webcom.sdkv2.datasync / TransactionOperation

TransactionOperation

sealed class TransactionOperation

Represents a write operation to perform on a data node within an atomic transaction.

See Also

DatasyncNode.runTransaction

Types

Abort

object Abort : TransactionOperation

Operation of aborting the transaction.

Remove

object Remove : TransactionOperation

Operation of removing the data node value, equivalent to Set(null).

Set

class Set : TransactionOperation

Operation of setting a given value to the data node.

Companion Object Properties

decrement

val decrement: (DatasyncValuable) -> TransactionOperation.Set

Transaction function that atomically decrements the value of a data node or sets its initial value to 0 if it had no value.

increment

val increment: (DatasyncValuable) -> TransactionOperation.Set

Transaction function that atomically increments the value of a data node or sets its initial value to 0 if it had no value.

Companion Object Functions

increment

fun increment(step: Int = 1, start: Int = 0): (DatasyncValuable) -> TransactionOperation.Set

Transaction function that atomically increments the value of a data node by a given step or sets the initial start value if the data node had no value.

toggle

fun toggle(defaultValue: Boolean = false): (DatasyncValuable) -> TransactionOperation

Transaction function that atomically toggles the value of a boolean data node.

fun <T : Any> toggle(ping: T, pong: T): (DatasyncValuable) -> TransactionOperation

Transaction function that atomically toggles the value of a data node between 2 values ping and pong.

writeIfNone

fun writeIfNone(value: Any?): (DatasyncValuable) -> TransactionOperation

Transaction function that atomically sets a given value to a data node only if it had no value.

Inheritors

Abort

object Abort : TransactionOperation

Operation of aborting the transaction.

Remove

object Remove : TransactionOperation

Operation of removing the data node value, equivalent to Set(null).

Set

class Set : TransactionOperation

Operation of setting a given value to the data node.