W3cubDocs

/Kotlin

Entry

interface Entry<out K, out V>

Represents a key/value pair held by a Map.

Properties

key

abstract val key: K

Returns the key of this key/value pair.

value

abstract val value: V

Returns the value of this key/value pair.

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

component1

operator fun <K, V> Entry<K, V>.component1(): K

Returns the key component of the map entry.

component2

operator fun <K, V> Entry<K, V>.component2(): V

Returns the value component of the map entry.

toPair

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

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

Inheritors

MutableEntry

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

Represents a key/value pair held by a MutableMap.

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