TypedMap

A map which can store heterogeneous values, where the type is constrained by the Key.

For example:

val IdKey = Key.create<MutableSet<String>>("ids")

val data = TypedMap()
data[IdKey] = mutableSetOf()
data.getValue(IdKey).add("hello")

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun <T : Any> computeIfAbsent(key: Key<T>, compute: () -> T): T
Link copied to clipboard
operator fun <T : Any> get(key: Key<T>): T?
Link copied to clipboard
fun <T : Any> getValue(key: Key<T>): T
Link copied to clipboard
operator fun <T : Any> set(key: Key<T>, value: T)