Class SerializableComparators


  • public final class SerializableComparators
    extends Object
    This class provides a minimal set of SerializableComparator methods for use in the API module.
    Since:
    11.1
    • Method Detail

      • naturalOrder

        public static <T> SerializableComparator<T> naturalOrder()
        Uses the natural compareTo methods of the objects which will throw if there are any nulls.
      • reverseNaturalOrder

        public static <T> SerializableComparator<T> reverseNaturalOrder()
        Uses the natural compareTo methods of the objects which will throw if there are any nulls.
      • reverse

        public static <T> SerializableComparator<T> reverse​(SerializableComparator<T> comparator)
        Parameters:
        comparator - original comparator whose order will be reversed
        Returns:
        A comparator that reverses the order of any other Serializable Comparator.