MutableEntry

interface MutableEntry<K, V> : Map.Entry<K, V> (source)

A map entry whose associated value can be replaced without changing its key.

Whether the entry is still attached to a map depends on the implementation and later mutations.

Type Parameters

K

key type.

V

value type.

Properties

Link copied to clipboard
abstract val key: K

Key identifying this association.

Link copied to clipboard
abstract val value: V

Value associated with key, including null for nullable value types.

Functions

Link copied to clipboard
operator fun <K, V> Map.Entry<K, V>.component1(): K

Returns this entry's key for destructuring.

Link copied to clipboard
operator fun <K, V> Map.Entry<K, V>.component2(): V

Returns this entry's current value for destructuring.

Link copied to clipboard
abstract fun setValue(newValue: V): V

Replaces this entry's value, leaving its key unchanged.