Package io.vavr.collection
Class Comparators
- java.lang.Object
-
- io.vavr.collection.Comparators
-
final class Comparators extends java.lang.ObjectINTERNAL: CommonComparatorrelated functions (not intended to be public).
-
-
Constructor Summary
Constructors Modifier Constructor Description privateComparators()
-
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
-
-