KvsEditor

interface KvsEditor

Builder for applying a batch of write operations to the store.

Call edit to obtain an instance, chain the desired mutations, then call commit to flush them atomically to the underlying storage.

Each mutation method returns this to support a fluent call chain:

kvs.edit()
.putString("theme", "dark")
.putBoolean("notifications", true)
.commit()

See also

Functions

Link copied to clipboard
Link copied to clipboard
abstract fun clear(): Kvs.KvsEditor

Stages the removal of ALL entries from the store.

Link copied to clipboard
abstract suspend fun commit()

Flushes all staged operations atomically to the underlying storage.

Link copied to clipboard
abstract fun putBoolean(key: String, value: Boolean): Kvs.KvsEditor

Stages a Boolean value to be persisted under key.

Link copied to clipboard
abstract fun putFloat(key: String, value: Float): Kvs.KvsEditor

Stages a Float value to be persisted under key.

Link copied to clipboard
abstract fun putInt(key: String, value: Int): Kvs.KvsEditor

Stages an Int value to be persisted under key.

Link copied to clipboard
abstract fun putLong(key: String, value: Long): Kvs.KvsEditor

Stages a Long value to be persisted under key.

Link copied to clipboard
abstract fun putString(key: String, value: String): Kvs.KvsEditor

Stages a String value to be persisted under key.

Link copied to clipboard
abstract fun remove(key: String): Kvs.KvsEditor

Stages the removal of the entry identified by key.