T - the generic type of the object to comparepublic class SortOrderComparator<T extends Comparable<T>> extends Object implements Comparator<T>
SortOrderComparator can be extended for adding the sort order
ascending or descending. The default sort order is ascending.| Modifier and Type | Field and Description |
|---|---|
static SortOrder |
DEFAULT_SORT_ORDER
The constant default sort order.
|
| Constructor and Description |
|---|
SortOrderComparator()
Instantiates a new
SortOrderComparator with the default sort order. |
SortOrderComparator(SortOrder sortOrder)
Instantiates a new
SortOrderComparator with the given sort order. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T object,
T compareWithObject) |
static <T extends Comparable<T>> |
of()
Factory method to create a new
SortOrderComparator with the default sort order. |
static <T extends Comparable<T>> |
of(SortOrder sortOrder)
Factory method to create a new
SortOrderComparator with the default sort order. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final SortOrder DEFAULT_SORT_ORDER
public SortOrderComparator()
SortOrderComparator with the default sort order.public SortOrderComparator(SortOrder sortOrder)
SortOrderComparator with the given sort order.sortOrder - the sort orderpublic static <T extends Comparable<T>> Comparator<T> of()
SortOrderComparator with the default sort order.T - the generic type of the object to compareComparator objectpublic static <T extends Comparable<T>> Comparator<T> of(SortOrder sortOrder)
SortOrderComparator with the default sort order.T - the generic type of the object to comparesortOrder - the sort orderComparator objectpublic int compare(T object, T compareWithObject)
compare in interface Comparator<T extends Comparable<T>>Copyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.