Package io.vavr.collection
Class Comparators
- java.lang.Object
-
- io.vavr.collection.Comparators
-
final class Comparators extends java.lang.Object
INTERNAL: CommonComparator
related functions (not intended to be public).
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Comparators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <U> java.util.Comparator<U>
naturalComparator()
Returns the natural comparator for type U, i.e.
-
-
-
Method Detail
-
naturalComparator
static <U> java.util.Comparator<U> naturalComparator()
Returns the natural comparator for type U, i.e. treating it asComparable<U>
. The returned comparator is alsojava.io.Serializable
.Please note that this will lead to runtime exceptions, if U is not Comparable.
- Type Parameters:
U
- The type- Returns:
- The natural Comparator of type U
-
-