Leaderboard Command

This commit is contained in:
Kenneth Endfinger
2021-12-22 02:53:36 -05:00
parent b410fdf9e0
commit 0159675567
6 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package cloud.kubelet.foundation.core
fun <T, R : Comparable<R>> Collection<T>.sortedBy(order: SortOrder, selector: (T) -> R?): List<T> =
if (order == SortOrder.Ascending) {
sortedBy(selector)
} else {
sortedByDescending(selector)
}