getOrPut

fun getOrPut(key: Iterable<K>, producer: () -> V): V

Fetch the value associated with the specified key, or install the value produced by applying producer if no value was available.

Return

The value associated with key, which may have been obtained from producer.

Parameters

key

The search key.

producer

How to produce a value if none was available.