T
- type of values being comparedpublic interface SerializableComparator<T>
extends java.util.Comparator<T>, java.io.Serializable
Comparator
that is also Serializable
.Modifier and Type | Method and Description |
---|---|
static <T,V extends java.lang.Comparable<? super V>> |
comparing(SerializableFunction<? super T,? extends V> keyExtractor)
Analogous to
Comparator.comparing(Function) , except that it takes in a SerializableFunction as the key extractor and returns a SerializableComparator . |
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
static <T,V extends java.lang.Comparable<? super V>> SerializableComparator<T> comparing(SerializableFunction<? super T,? extends V> keyExtractor)
Comparator.comparing(Function)
, except that it takes in a SerializableFunction
as the key extractor and returns a SerializableComparator
.T
- the type of element to be comparedV
- the type of the Comparable
sort keykeyExtractor
- the function used to extract the Comparable
sort keySerializableComparator
that compares by an extracted keyComparator.comparing(Function)