Entry

Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
interface Entry<out K, out V>

Represents a key/value pair held by a Map.

Properties

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

key

Returns the key of this key/value pair.

abstract val key: K
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

value

Returns the value of this key/value pair.

abstract val value: V

Extension Functions

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

component1

Returns the key component of the map entry.

operator fun <K, V> Entry<K, V>.component1(): K
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

component2

Returns the value component of the map entry.

operator fun <K, V> Entry<K, V>.component2(): V
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

toPair

Converts entry to Pair with key being first component and value being second.

fun <K, V> Entry<K, V>.toPair(): Pair<K, V>

Inheritors

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

MutableEntry

Represents a key/value pair held by a MutableMap.

interface MutableEntry<K, V> : Entry<K, V>

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/-entry/index.html