minBy

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

Returns the entry that yields the smallest value according to the given selector.

By default, the local entry is excluded from the comparison. It is included only if reductionType is IncludingSelf.

If multiple entries produce the same minimal value, one is returned arbitrarily. If the field contains no applicable entries, the result is null.

Return

the entry with the lowest value as determined by selector, 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.