gradle
8.3

# Comparator

open class Comparator<T> : Comparator<T>

A comparator implementation based on the names returned by the given namer.

#### Parameters

<T>

The type of object that the namer can name

## Constructors

Comparator
Link copied to clipboard
constructor(namer: Namer<out Any>)

## Functions

compare
Link copied to clipboard
open fun compare(o1: T, o2: T): Int
comparing
Link copied to clipboard
open fun <T, U> comparing(keyExtractor: (out Any) -> out U, keyComparator: Comparator<out Any>): Comparator<T>
comparingDouble
Link copied to clipboard
open fun <T> comparingDouble(keyExtractor: ToDoubleFunction<out Any>): Comparator<T>
comparingInt
Link copied to clipboard
open fun <T> comparingInt(keyExtractor: ToIntFunction<out Any>): Comparator<T>
comparingLong
Link copied to clipboard
open fun <T> comparingLong(keyExtractor: ToLongFunction<out Any>): Comparator<T>
equals
Link copied to clipboard
open fun equals(obj: Any): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
naturalOrder
Link copied to clipboard
open fun <T : Comparable<out Any>?> naturalOrder(): Comparator<T>
nullsFirst
Link copied to clipboard
open fun <T> nullsFirst(comparator: Comparator<out Any>): Comparator<T>
nullsLast
Link copied to clipboard
open fun <T> nullsLast(comparator: Comparator<out Any>): Comparator<T>
reversed
Link copied to clipboard
open fun reversed(): Comparator<T>
reverseOrder
Link copied to clipboard
open fun <T : Comparable<out Any>?> reverseOrder(): Comparator<T>
thenComparing
Link copied to clipboard
open fun thenComparing(other: Comparator<out Any>): Comparator<T>
thenComparingDouble
Link copied to clipboard
open fun thenComparingDouble(keyExtractor: ToDoubleFunction<out Any>): Comparator<T>
thenComparingInt
Link copied to clipboard
open fun thenComparingInt(keyExtractor: ToIntFunction<out Any>): Comparator<T>
thenComparingLong
Link copied to clipboard
open fun thenComparingLong(keyExtractor: ToLongFunction<out Any>): Comparator<T>