public final class SerializableComparators extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T,V extends Comparable<? super V>> |
byFunction(Function<? super T,? extends V> function) |
static <T,V> SerializableComparator<T> |
byFunction(Function<? super T,? extends V> function,
SerializableComparator<V> comparator) |
static <T> SerializableComparator<T> |
naturalOrder()
Uses the natural compareTo methods of the objects which will throw if there are any nulls.
|
static <T> SerializableComparator<T> |
reverse(SerializableComparator<T> comparator) |
static <T> SerializableComparator<T> |
reverseNaturalOrder()
Uses the natural compareTo methods of the objects which will throw if there are any nulls.
|
public static <T> SerializableComparator<T> naturalOrder()
public static <T> SerializableComparator<T> reverseNaturalOrder()
public static <T> SerializableComparator<T> reverse(SerializableComparator<T> comparator)
comparator - original comparator whose order will be reversedpublic static <T,V extends Comparable<? super V>> SerializableComparator<T> byFunction(Function<? super T,? extends V> function)
public static <T,V> SerializableComparator<T> byFunction(Function<? super T,? extends V> function, SerializableComparator<V> comparator)
Copyright © 2004–2022. All rights reserved.