Class CaddyComparator<T extends Data>

  • Type Parameters:
    T - subclass of Data
    All Implemented Interfaces:
    java.util.Comparator<T>

    public class CaddyComparator<T extends Data>
    extends java.lang.Object
    implements java.util.Comparator<T>
    Compares Data based on their presence in the Caddy.
    Since:
    jcms-5.7
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(T data1, T data2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • CaddyComparator

        public CaddyComparator​(java.util.Comparator<T> comparator)
        Contructs a new CaddyComparator using the specified comparator.
        Parameters:
        comparator - the Comparator to use when Data are either both in caddy or else both not in caddy, also if object could not be compared (for example when no Caddy could be retrieved or if object are not instance of Data).
        Throws:
        java.lang.IllegalArgumentException - when specified comparator is null.
    • Method Detail

      • compare

        public int compare​(T data1,
                           T data2)
        Specified by:
        compare in interface java.util.Comparator<T extends Data>