arch-android

//Android/br.com.arch.toolkit.android.storage.keyValue/KeyValueStorage

KeyValueStorage

interface KeyValueStorage

Generic key-value storage abstraction used across the toolkit.

Implementations may be in-memory, SharedPreferences-based, encrypted, or custom.

Inheritors

 
MemoryStorage
SharedPrefStorage

Properties

Name Summary
name [android]
abstract val name: String
Unique storage name.
type [android]
abstract val type: StorageType
Storage backend category.

Functions

Name Summary
clear [android]
abstract fun clear()
Removes every entry.
contains [android]
abstract fun contains(key: String): Boolean
Returns true when key exists.
get [android]
abstract operator fun <T : Any> get(key: String): T?
Reads a value associated with key.
[android]
open operator fun <T : Any> get(key: String, default: T): T
Reads a value or returns default when absent.
keys [android]
abstract fun keys(): List<String>
Snapshot of all keys currently stored.
remove [android]
abstract fun remove(key: String)
Removes a single key.
[android]
open fun remove(regex: Regex)
Removes every key that matches regex.
set [android]
abstract operator fun <T : Any> set(key: String, value: T?)
Stores value under key.
size [android]
abstract fun size(): Int
Total number of stored entries.