set

abstract operator fun set(key: K, value: V): Optional<out Pair<K, V>>

Stores a new key-value pair in this cache, possibly evicting some previously stored key-value pair

Return

the evicted key-value pair, if any

Parameters

key

is the key used for indexing the pair

value

is the value corresponding to key