Raed Ghazal
09/23/2023, 1:36 PMval order = Status.values().asList()
statuses
.groupingBy { it }
.eachCount()
.toSortedMap { t, t2 ->
order.indexOf(t) - order.indexOf(t2)
}
Spoudel347
09/23/2023, 1:54 PMval order = Status.entries.toList()
statuses
.groupingBy { it }
.eachCount()
.map { it.key to it.value }
.sortedBy {
order.indexOf(it.first)
}.toMap()
Raed Ghazal
09/23/2023, 1:55 PM