Get started

ImmutableMap

interface ImmutableMap<K, out V> : Map<K, V> (source)

A generic immutable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the immutable map.

Modification operations are supported through the PersistentMap interface.

Implementors of this interface take responsibility to be immutable. Once constructed they must contain the same elements in the same order.

Type Parameters

K

the type of map keys. The map is invariant on its key type, as it can accept key as a parameter (of containsKey for example) and return it in keys set.

V

the type of map values. The map is covariant on its value type.

Inheritors

Properties

Link copied to clipboard
abstract override val entries: ImmutableSet<Map.Entry<K, V>>
Link copied to clipboard
abstract override val keys: ImmutableSet<K>
Link copied to clipboard
abstract override val values: ImmutableCollection<V>