Class TransformingComparator

java.lang.Object
org.apache.commons.collections.comparators.TransformingComparator
All Implemented Interfaces:
Comparator

@Deprecated(since="2021-04-30") public class TransformingComparator extends Object implements Comparator
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Decorates another Comparator with transformation behavior. That is, the return value from the transform operation will be passed to the decorated compare method.
Since:
Commons Collections 2.0 (?)
See Also:
  • Constructor Details

    • TransformingComparator

      public TransformingComparator(Transformer transformer)
      Deprecated.
      Constructs an instance with the given Transformer and a ComparableComparator.
      Parameters:
      transformer - what will transform the arguments to compare
    • TransformingComparator

      public TransformingComparator(Transformer transformer, Comparator decorated)
      Deprecated.
      Constructs an instance with the given Transformer and Comparator.
      Parameters:
      transformer - what will transform the arguments to compare
      decorated - the decorated Comparator
  • Method Details

    • compare

      public int compare(Object obj1, Object obj2)
      Deprecated.
      Returns the result of comparing the values from the transform operation.
      Specified by:
      compare in interface Comparator
      Parameters:
      obj1 - the first object to transform then compare
      obj2 - the second object to transform then compare
      Returns:
      negative if obj1 is less, positive if greater, zero if equal