Storage

interface Storage

存储接口,提供键值对的存储操作功能

该接口定义了对键值对数据的基本操作,包括获取、存入、移除、判断包含、清空以及遍历等功能, 可用于管理特定命名空间下的键值对数据。

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun clear(): Boolean

清空所有键值对

Link copied to clipboard
abstract fun contains(key: String): Boolean

判断是否包含指定的键

Link copied to clipboard
abstract fun forEach(action: (String, String) -> Unit)

遍历所有键值对并执行指定操作

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

根据键获取对应的值

Link copied to clipboard
abstract fun put(key: String, value: String): Boolean

存入键值对

Link copied to clipboard
abstract fun remove(key: String): Boolean

移除指定键对应的键值对