getOrPut

fun getOrPut(key: K, defaultValue: () -> V): V

Returns the live value for key if present, otherwise computes it with defaultValue, stores it through put, and returns it.

A hit marks the entry most recently used. An expired entry counts as a miss and is replaced.