Class InvertibleComparator<T>

  • Type Parameters:
    T - the type of objects that may be compared by this comparator
    All Implemented Interfaces:
    Serializable, Comparator<T>

    @Deprecated
    public class InvertibleComparator<T>
    extends Object
    implements Comparator<T>, Serializable
    Deprecated.
    as of Spring Framework 5.0, in favor of the standard JDK 8 Comparator.reversed()
    A decorator for a comparator, with an "ascending" flag denoting whether comparison results should be treated in forward (standard ascending) order or flipped for reverse (descending) order.
    Since:
    1.2.2
    Author:
    Keith Donald, Juergen Hoeller
    See Also:
    Serialized Form
    • Constructor Detail

      • InvertibleComparator

        public InvertibleComparator​(Comparator<T> comparator)
        Deprecated.
        Create an InvertibleComparator that sorts ascending by default. For the actual comparison, the specified Comparator will be used.
        Parameters:
        comparator - the comparator to decorate
      • InvertibleComparator

        public InvertibleComparator​(Comparator<T> comparator,
                                    boolean ascending)
        Deprecated.
        Create an InvertibleComparator that sorts based on the provided order. For the actual comparison, the specified Comparator will be used.
        Parameters:
        comparator - the comparator to decorate
        ascending - the sort order: ascending (true) or descending (false)