Top Description Constructors Methods
io.vavr.collection

pack-priv final Class Comparators

Additional top-level class in compilation unit: NaturalComparator.

extends Object
Class Inheritance
Imports
java.io.Serializable, java.util.Comparator

INTERNAL: Common Comparator related functions (not intended to be public).
Author
Daniel Dietrich

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static <
The type
U
>
Comparator<U>

Returns:

The natural Comparator of type U
naturalComparator
()

Returns the natural comparator for type U, i.e. treating it as Comparable<U>.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Comparatorsback to summary
private Comparators()

Method Detail

naturalComparatorback to summary
pack-priv static <U> Comparator<U> naturalComparator()

Returns the natural comparator for type U, i.e. treating it as Comparable<U>. The returned comparator is also java.io.Serializable.

Please note that this will lead to runtime exceptions, if U is not Comparable.

Parameters
<U>
The type
Returns:Comparator<U>

The natural Comparator of type U

Annotations
@SuppressWarnings:unchecked