get

abstract operator fun <T : Any> get(key: KeyValueStorage.Key<T>): T?

Gets the value stored for the given key, or null if no value was stored for the key.

open fun <T : Any> get(key: KeyValueStorage.Key<T>, defaultValue: T): T

Gets the value stored for the given key, or returns the passed defaultValue if no value was stored for the key. If no value is stored for the key, the defaultValue will NOT be stored in the storage. Use set method to store a value.