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 aSerializableFunctionas 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 aSerializableFunctionas the key extractor and returns aSerializableComparator.- Type Parameters:
T- the type of element to be comparedV- the type of theComparablesort key- Parameters:
keyExtractor- the function used to extract theComparablesort key- Returns:
- A
SerializableComparatorthat compares by an extracted key - See Also:
-