arch-android

//Android/br.com.arch.toolkit.android.storage.delegate/NonOptionalStorageDelegate

NonOptionalStorageDelegate

data class NonOptionalStorageDelegate<T : Any> : StorageDelegate<T>

A property delegate for non-optional values in KeyValueStorage.

It wraps an OptionalStorageDelegate and provides a default value if the stored value is null.

Parameters

android

   
T The type of data to store.

Functions

Name Summary
getValue [android]
operator fun getValue(thisRef: Any?, property: KProperty<*>): T
setValue [android]
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T)
storage [android]
fun storage(storage: KeyValueStorage): NonOptionalStorageDelegate<T>
Configures the KeyValueStorage for this delegate.
[android]
fun storage(storage: () -> KeyValueStorage): NonOptionalStorageDelegate<T>
Configures the KeyValueStorage provider for this delegate.
threshold [android]
fun threshold(threshold: Duration): NonOptionalStorageDelegate<T>
Configures the expiration threshold for the memory cache.