I have a Map of <String, Object>, where the key string can be converted into an integer index <Int, Object> then I want to sort by the Int index and order the object to get a List<Object>.
Is there a functional way to write that? Can I do a map on a Map and get a Map as the result?
r
Ruckus
06/08/2018, 7:14 PM
The mapping code you're looking for would be
map.mapKeys { it.key.toInt() }
, but that would not be the most efficient way to solve your problem (see the answers posted).