Package org.springframework.util.comparator

# Class ComparableComparator<T extends Comparable<T>>

java.lang.Object
org.springframework.util.comparator.ComparableComparator<T>

Type Parameters:
  `T` - the type of comparable objects that may be compared by this comparator

All Implemented Interfaces:
  `Comparator<T>`

@Deprecated(since="6.1") public class ComparableComparator<T extends Comparable<T>> extends Object implements Comparator<T>
Deprecated.
as of 6.1 in favor of `Comparator.naturalOrder()`
Comparator that adapts Comparables to the Comparator interface. Mainly for internal use in other Comparators, when supposed to work on Comparables.

Since:
  1.2.2
Author:
  Keith Donald
See Also:
  - `Comparable`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ComparableComparator`
`INSTANCE`
Deprecated.
A shared instance of this default comparator.

## Constructor Summary

Constructors
Constructor
Description
`ComparableComparator()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`int`
`compare(T o1, T o2)`
Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Comparator

`equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

## Field Details

### INSTANCE

public static final ComparableComparator INSTANCE
Deprecated.
A shared instance of this default comparator.

See Also:
  - `Comparators.comparable()`

## Constructor Details

### ComparableComparator

public ComparableComparator()
Deprecated.

## Method Details

### compare

public int compare(T o1, T o2)
Deprecated.

Specified by:
  `compare` in interface `Comparator<T extends Comparable<T>>`