main.phraseapp.extensions.MapExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-client Show documentation
Show all versions of gradle-client Show documentation
JVM client to interact with Phrase via its API.
The newest version!
package phraseapp.extensions
fun Iterable>.associateWithList(): Map> {
val map = mutableMapOf>()
forEach {
if (map.containsKey(it.first)) {
val list = map[it.first]!!
list.add(it.second)
map.replace(it.first, list)
} else {
map[it.first] = arrayListOf(it.second)
}
}
return map
}