reorderBy

inline fun <T, R> Iterable<T>.reorderBy(order: List<R>, crossinline selector: (T) -> R): List<T>

Parameters

selector

is a function using which the value by which we reorder is going to be selected, must be the same value that is specified in the order

order

a list of objects that represents the order which should be used to sort the original list