commonMain.tz.co.asoft.InMemoryKeyValueStorage.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persist-keyvalue-inmemory-jvm Show documentation
Show all versions of persist-keyvalue-inmemory-jvm Show documentation
Platform agnostic contracts for persisting key-value pairs in memory
The newest version!
package tz.co.asoft
class InMemoryKeyValueStorage(override val namespace: String = "") : KeyValueStorage {
val data = mutableMapOf()
override fun clear() = data.clear()
override fun get(key: String): String? = data[key]
override fun remove(key: String) {
data.remove(key)
}
override fun set(key: String, value: String) {
data[key] = value
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy