Maps

interface Maps

Functions

Link copied to clipboard
abstract suspend fun create(uniqueName: String? = null, ttl: <Error class: unknown class> = Duration.INFINITE): SyncMap

Create new SyncMap object.

Link copied to clipboard
abstract suspend fun getMapItem(mapSidOrUniqueName: String, itemKey: String, useCache: Boolean = true): SyncMap.Item?

Retrieve Item from the SyncMap without opening it.

Link copied to clipboard
abstract suspend fun mutateMapItem(mapSidOrUniqueName: String, itemKey: String, mutator: suspend (<Error class: unknown class>?) -> <Error class: unknown class>?): SyncMap.Item

Mutate value of the SyncMap.Item without opening SyncMap using provided Mutator function.

Link copied to clipboard
inline suspend fun <T : Any> Maps.mutateMapItem(mapSidOrUniqueName: String, itemKey: String, crossinline mutator: suspend (currentData: T?) -> T?): SyncMap.Item

Serializes the value returned by Mutator function into an equivalent JsonObject using a serializer retrieved from reified type parameter and uses the JsonObject to mutate value of the SyncMap.Item without opening the map.

Link copied to clipboard
abstract suspend fun mutateMapItemWithTtl(mapSidOrUniqueName: String, itemKey: String, ttl: <Error class: unknown class>, mutator: suspend (<Error class: unknown class>?) -> <Error class: unknown class>?): SyncMap.Item

Mutate value of the SyncMap.Item without opening SyncMap using provided Mutator function.

Link copied to clipboard
inline suspend fun <T> Maps.mutateMapItemWithTtl(mapSidOrUniqueName: String, itemKey: String, ttl: <Error class: unknown class>, crossinline mutator: suspend (currentData: T?) -> T?): SyncMap.Item

Serializes the value returned by Mutator function into an equivalent JsonObject using a serializer retrieved from reified type parameter and uses the JsonObject to mutate value of the SyncMap.Item without opening the map.

Link copied to clipboard
abstract suspend fun openExisting(sidOrUniqueName: String): SyncMap

Open existing SyncMap by SID or unique name.

Link copied to clipboard
abstract suspend fun openOrCreate(uniqueName: String, ttl: <Error class: unknown class> = Duration.INFINITE): SyncMap

Open existing SyncMap by unique name or create a new one if specified name does not exist.

Link copied to clipboard
abstract fun queryItems(mapSidOrUniqueName: String, startKey: String? = null, includeStartKey: Boolean = true, queryOrder: <Error class: unknown class> = QueryOrder.Ascending, pageSize: Int = kDefaultPageSize, useCache: Boolean = true): SyncIterator<SyncMap.Item>

Retrieve items without opening the SyncMap.

Link copied to clipboard
abstract suspend fun remove(sidOrUniqueName: String)

Remove SyncMap without opening it.

Link copied to clipboard
abstract suspend fun removeMapItem(mapSidOrUniqueName: String, itemKey: String)

Remove SyncMap.Item without opening the SyncMap.

Link copied to clipboard
abstract suspend fun setMapItem(mapSidOrUniqueName: String, itemKey: String, itemData: <Error class: unknown class>): SyncMap.Item

Set Item in the SyncMap without opening it.

Link copied to clipboard
inline suspend fun <T : Any> Maps.setMapItem(mapSidOrUniqueName: String, itemKey: String, itemData: T): SyncMap.Item

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncMap.Item without opening the map.

Link copied to clipboard
abstract suspend fun setMapItemWithTtl(mapSidOrUniqueName: String, itemKey: String, itemData: <Error class: unknown class>, ttl: <Error class: unknown class>): SyncMap.Item

Set Item in the SyncMap without opening it.

Link copied to clipboard
inline suspend fun <T : Any> Maps.setMapItemWithTtl(mapSidOrUniqueName: String, itemKey: String, itemData: T, ttl: <Error class: unknown class>): SyncMap.Item

Serializes the given value into an equivalent JsonObject using a serializer retrieved from reified type parameter and set it as value of the SyncMap.Item without opening the map.

Link copied to clipboard
abstract suspend fun setTtl(sidOrUniqueName: String, ttl: <Error class: unknown class>)

Set time to live for SyncMap without opening it.