public class OrderUtil
extends java.lang.Object
Ordered
interface to lists or arrays.Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<java.lang.Object> |
COMPARATOR
Provide a comparator for collections.
|
static java.util.Comparator<java.lang.Object> |
REVERSE_COMPARATOR
Provide a comparator, in reversed order, for collections.
|
Constructor and Description |
---|
OrderUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
reverseSort(java.util.List<?> list)
Sort the given list.
|
static void |
reverseSort(java.lang.Object[] array)
Sort the given array in reverse order.
|
static void |
sort(java.util.List<?> list)
Sort the given list.
|
static void |
sort(java.lang.Object[] objects)
Sort the given array.
|
static void |
sort(Ordered... objects)
Sort the given array.
|
static <T> java.util.stream.Stream<T> |
sort(java.util.stream.Stream<T> list)
Sort the given list.
|
public static final java.util.Comparator<java.lang.Object> COMPARATOR
public static final java.util.Comparator<java.lang.Object> REVERSE_COMPARATOR
public static void sort(java.util.List<?> list)
list
- The list to sortpublic static <T> java.util.stream.Stream<T> sort(java.util.stream.Stream<T> list)
T
- The stream generic typelist
- The list to sortpublic static void reverseSort(java.util.List<?> list)
list
- The list to sortpublic static void reverseSort(java.lang.Object[] array)
array
- The array to sortpublic static void sort(Ordered... objects)
objects
- The array to sortpublic static void sort(java.lang.Object[] objects)
objects
- The array to sort