kvCache

fun kvCache(key: String? = null, defaultValue: Float = 0.0f): KVCachePropertyFloat
fun kvCache(key: String? = null, defaultValue: Int = 0): KVCachePropertyInt
fun kvCache(key: String? = null, defaultValue: Double = 0.0): KVCachePropertyDouble
fun kvCache(key: String? = null, defaultValue: Long = 0): KVCachePropertyLong
fun kvCache(key: String? = null, defaultValue: Boolean = false): KVCachePropertyBoolean
fun kvCache(key: String? = null, defaultValue: String? = null): KVCachePropertyString
fun kvCache(key: String? = null, defaultValue: Set<String>? = null): KVCachePropertyStringSet
fun kvCache(key: String? = null, defaultValue: ByteArray? = null): KVCachePropertyByteArray
inline fun <T : Parcelable> kvCache(key: String? = null, defaultValue: T? = null): KVCachePropertyParcelable<T>

Parameters

key

当 key不为空时,根据 key 来缓存对应的值,当 key 为空时,则取属性名称作为 key 来缓存对应的值

defaultValue

默认值


fun <T : Parcelable> kvCache(key: String? = null, tClass: Class<T>, defaultValue: T? = null): KVCachePropertyParcelable<T>

Parameters

key

当 key不为空时,根据 key 来缓存对应的值,当 key 为空时,则取属性名称作为 key 来缓存对应的值

tClass

泛型 T 对应的类

defaultValue

默认值