Package org.apache.beam.sdk.transforms
Interface SerializableComparator<T>
- Type Parameters:
T
- type of values being compared
- All Superinterfaces:
Comparator<T>
,Serializable
- All Known Implementing Classes:
KV.OrderByKey
,KV.OrderByValue
A
Comparator
that is also Serializable
.-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T,
V extends Comparable<? super V>>
SerializableComparator<T> comparing
(SerializableFunction<? super T, ? extends V> keyExtractor) Analogous toComparator.comparing(Function)
, except that it takes in aSerializableFunction
as the key extractor and returns aSerializableComparator
.Methods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
comparing
static <T,V extends Comparable<? super V>> SerializableComparator<T> comparing(SerializableFunction<? super T, ? extends V> keyExtractor) Analogous toComparator.comparing(Function)
, except that it takes in aSerializableFunction
as the key extractor and returns aSerializableComparator
.- Type Parameters:
T
- the type of element to be comparedV
- the type of theComparable
sort key- Parameters:
keyExtractor
- the function used to extract theComparable
sort key- Returns:
- A
SerializableComparator
that compares by an extracted key - See Also:
-