Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.persistence/DataStore/Editor

Editor

interface Editor : ReadableDataStore, AutoCloseable

Enables editing multiple entries in the module storage in a transactional way.

All updating/reading methods will throw EditorClosedException if the Editor has already been closed.

Types

EditorClosedException
Link copied to clipboard
class EditorClosedException(message: String) : TealiumException

This exception signifies that the Editor was interacted with after it has been closed.

Functions

clear
Link copied to clipboard
abstract fun clear(): DataStore.Editor

Clears all entries from storage before then adding any any key-value pairs added to this editor.

close
Link copied to clipboard
abstract fun close()
commit
Link copied to clipboard
abstract fun commit()

Writes the updates to disk.

count
Link copied to clipboard
abstract fun count(): Int

Returns the number of entries in this DataStore

extract
Link copied to clipboard
open override fun extract(jsonPath: JsonPath<JsonPath.Component.Key>): DataItem?

Extracts a nested DataItem according to the given jsonPath.

open fun <T> extract(jsonPath: JsonPath<JsonPath.Component.Key>, converter: DataItemConverter<T>): T?

Extracts a nested DataItem according to the given jsonPath, and attempts to convert it to the type T using the given converter

extractBoolean
Link copied to clipboard
open fun extractBoolean(jsonPath: JsonPath<JsonPath.Component.Key>): Boolean?

Extracts a nested Boolean according to the given jsonPath.

extractDataList
Link copied to clipboard
open fun extractDataList(jsonPath: JsonPath<JsonPath.Component.Key>): DataList?

Extracts a nested DataList according to the given jsonPath.

extractDataObject
Link copied to clipboard
open fun extractDataObject(jsonPath: JsonPath<JsonPath.Component.Key>): DataObject?

Extracts a nested DataObject according to the given jsonPath.

extractDouble
Link copied to clipboard
open fun extractDouble(jsonPath: JsonPath<JsonPath.Component.Key>): Double?

Extracts a nested Double according to the given jsonPath.

extractInt
Link copied to clipboard
open fun extractInt(jsonPath: JsonPath<JsonPath.Component.Key>): Int?

Extracts a nested Int according to the given jsonPath.

extractLong
Link copied to clipboard
open fun extractLong(jsonPath: JsonPath<JsonPath.Component.Key>): Long?

Extracts a nested Long according to the given jsonPath.

extractString
Link copied to clipboard
open fun extractString(jsonPath: JsonPath<JsonPath.Component.Key>): String?

Extracts a nested String according to the given jsonPath.

get
Link copied to clipboard
abstract fun get(key: String): DataItem?

Gets the DataItem stored at the given key if there is one

open fun <T> get(key: String, converter: DataItemConverter<T>): T?

Gets the DataItem stored at the given key if there is one, and uses the given converter to translate it into an instance of type T

getAll
Link copied to clipboard
abstract fun getAll(): DataObject

Gets the entire DataObject containing all data stored.

getBoolean
Link copied to clipboard
open fun getBoolean(key: String): Boolean?

Gets the Boolean stored at the given key if there is one

getDataList
Link copied to clipboard
open fun getDataList(key: String): DataList?

Gets the DataList stored at the given key if there is one

getDataObject
Link copied to clipboard
open fun getDataObject(key: String): DataObject?

Gets the DataObject stored at the given key if there is one

getDouble
Link copied to clipboard
open fun getDouble(key: String): Double?

Gets the Double stored at the given key if there is one

getInt
Link copied to clipboard
open fun getInt(key: String): Int?

Gets the Int stored at the given key if there is one

getLong
Link copied to clipboard
open fun getLong(key: String): Long?

Gets the Long stored at the given key if there is one

getString
Link copied to clipboard
open fun getString(key: String): String?

Gets the String stored at the given key if there is one

keys
Link copied to clipboard
abstract fun keys(): List<String>

Returns all keys stored in this DataStore

put
Link copied to clipboard
abstract fun put(key: String, value: DataItem, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: DataItemConvertible, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: DataList, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: DataObject, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: Boolean, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: Double, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: Int, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: Long, expiry: Expiry): DataStore.Editor
open fun put(key: String, value: String, expiry: Expiry): DataStore.Editor

Adds a single key-value pair to the storage

putAll
Link copied to clipboard
abstract fun putAll(dataObject: DataObject, expiry: Expiry): DataStore.Editor

Adds all key-value pairs from the dataObject into the storage.

remove
Link copied to clipboard
abstract fun remove(key: String): DataStore.Editor

Removes and individual key from storage

abstract fun remove(keys: List<String>): DataStore.Editor

Removes multiple keys from storage

Generated by Dokka
(c) Tealium 2026