NoOpCache

class NoOpCache<K, V> : Cache<K, V>

A no-op cache that doesn't store anything. Useful for disabling caching when needed.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun clear()

Clear all entries from the cache.

Link copied to clipboard
open override fun contains(key: K): Boolean

Check if a key exists in the cache.

Link copied to clipboard
open override fun get(key: K): V?

Get a value from the cache.

Link copied to clipboard
open suspend override fun getOrPut(key: K, defaultValue: suspend () -> V): V

Get a value or compute and cache it if missing.

Link copied to clipboard
open override fun isEmpty(): Boolean

Check if cache is empty

Link copied to clipboard
open override fun keys(): Set<K>

Get all keys in the cache.

Link copied to clipboard
open suspend override fun put(key: K, value: V)

Store a value in the cache.

Link copied to clipboard
open suspend override fun remove(key: K): V?

Remove a value from the cache.

Link copied to clipboard
open override fun size(): Int

Get the number of cached entries.

Link copied to clipboard
open override fun values(): Collection<V>

Get all values in the cache.