https://kotlinlang.org logo
n

nfrankel

09/20/2019, 10:15 PM
i managed it by doing this
Copy code
internal class MapEntry<K, V>(override val key: K, override val value: V) : Map.Entry<K, V>
internal fun <K, V> Pair<K, V>.toEntry() = MapEntry(first, second)
m

Matteo Mirk

09/23/2019, 1:19 PM
you could
import java.util.AbstractMap
and avoid to create your own entry class:
Copy code
... = AbstractMap.SimpleEntry(first, second)
👍 1
n

nfrankel

09/23/2019, 2:56 PM
Didn't see that one Thanks 👍
m

Matteo Mirk

09/23/2019, 3:06 PM
you’re welcome
2 Views