spring-framework / org.springframework.util.comparator / ComparableComparator

ComparableComparator

open class ComparableComparator<T : Comparable<T>> : Comparator<T>

Comparator that adapts Comparables to the Comparator interface. Mainly for internal use in other Comparators, when supposed to work on Comparables.

Author
Keith Donald

Since
1.2.2

See Also
Comparable

Constructors

<init>

ComparableComparator()

Comparator that adapts Comparables to the Comparator interface. Mainly for internal use in other Comparators, when supposed to work on Comparables.

Properties

INSTANCE

static val INSTANCE: ComparableComparator<Comparable<*>>

A shared instance of this default comparator

Functions

compare

open fun compare(o1: T, o2: T): Int