Nikita
06/26/2019, 5:28 PMenum class Events {
"one",
"two",
"three"
}
And I need to get List<Map> like this:
({name: "one", id: "one"}, {name: "two", id: "two"}, {name: "three", id: "three"})
Is there idiomatic way to do this? No ‘for’ loop.RoqueRueda
06/26/2019, 5:30 PMRuckus
06/26/2019, 5:30 PMShawn
06/26/2019, 5:33 PMenum class Events {
ONE,
TWO,
THREE,
}
val mappings = Events.values().map {
mapOf("name" to it.name.toLowerCase(), "id" to it.name.toLowerCase())
}
Nikita
06/26/2019, 6:22 PM