Cache

interface Cache<K, V>

A cache with operations to add, update, retrieve, and remove entries.

Functions

Link copied to clipboard
abstract suspend fun clear()

Removes all entries from the Cache.

Link copied to clipboard
abstract suspend fun get(key: K): V?
Link copied to clipboard
abstract suspend fun put(key: K, value: V)

Associates the given key with the given value. If key is already in the Cache the value will be overwritten by value.

Link copied to clipboard
abstract suspend fun putAll(pairs: Iterable<Pair<K, V>>)

Each pair will be inserted into the cache associating the Pair.first element with Pair.second. If Pair.first is already in the Cache the value will be overwritten by Pair.second.

Link copied to clipboard
abstract suspend fun remove(key: K)

Removes the entry for key from the Cache.