maxValueBy

inline fun <ID : Any, T, R : Comparable<R>> Field<ID, T>.maxValueBy(reductionType: ReductionType = ExcludingSelf, crossinline selector: (FieldEntry<ID, T>) -> R): T?

Returns the value of the entry that yields the largest value according to the given selector.

Return

the value of the entry with the highest score, or null if none.

Parameters

reductionType

specifies whether to include the local entry in the comparison (default is ExcludingSelf).

selector

a function that maps each entry to a comparable value.