Class SerializableComparators
java.lang.Object
org.eclipse.collections.api.block.factory.SerializableComparators
This class provides a minimal set of SerializableComparator methods for use in the API module.
- Since:
- 11.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final SerializableComparator
<?> private static final SerializableComparator
<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
V extends Comparable<? super V>>
SerializableComparator<T> 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> 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> Uses the natural compareTo methods of the objects which will throw if there are any nulls.
-
Field Details
-
NATURAL_ORDER_COMPARATOR
-
REVERSE_NATURAL_ORDER_COMPARATOR
-
-
Constructor Details
-
SerializableComparators
private SerializableComparators()
-
-
Method Details
-
naturalOrder
Uses the natural compareTo methods of the objects which will throw if there are any nulls. -
reverseNaturalOrder
Uses the natural compareTo methods of the objects which will throw if there are any nulls. -
reverse
- Parameters:
comparator
- original comparator whose order will be reversed- Returns:
- A comparator that reverses the order of any other Serializable Comparator.
-
byFunction
public static <T,V extends Comparable<? super V>> SerializableComparator<T> byFunction(Function<? super T, ? extends V> function) -
byFunction
public static <T,V> SerializableComparator<T> byFunction(Function<? super T, ? extends V> function, SerializableComparator<V> comparator)
-