rocketraman
06/22/2016, 6:04 PMmapOf(...)
with conditions on the existence of each pair i.e. something like this obviously broken code:
mapOf(
if(conditionA) "a" to "b",
if(conditionB) "b" to "c"
)
For a mutable map I could use apply
but obviously that doesn't work for `mapOf`:
mutableMapOf<String, String>().apply {
if(conditionA) put("a", "b")
if(conditionB) put("b", "c")
}