nullsLast

fun <T : Any> nullsLast(comparator: Comparator<in T>): Comparator<T?>(source)

Extends the given comparator of non-nullable values to a comparator of nullable values considering null value greater than any other value. Non-null values are compared with the provided comparator.

Since Kotlin

1.0

Samples


inline fun <T : Comparable<T>> nullsLast(): Comparator<T?>(source)

Provides a comparator of nullable Comparable values considering null value greater than any other value. Non-null values are compared according to their natural order.

Since Kotlin

1.0

Samples