Map.Entry.toPair

This commit is contained in:
Ilya Ryzhenkov
2014-06-10 00:20:54 +04:00
parent 0e656ce3ce
commit 2855741572
@@ -40,6 +40,11 @@ fun <K, V> Map.Entry<K, V>.component2(): V {
return getValue()
}
/** Converts entry to Pair with key being first component and value being second */
fun <K, V> Map.Entry<K, V>.toPair(): Pair<K, V> {
return Pair(getKey(), getValue())
}
/**
* Returns the value for the given key or returns the result of the defaultValue function if there was no entry for the given key
*