Class WhatsNewComparator

java.lang.Object
fr.paris.lutece.plugins.whatsnew.utils.sort.WhatsNewComparator
All Implemented Interfaces:
Serializable, Comparator<IWhatsNew>

public class WhatsNewComparator extends Object implements Comparator<IWhatsNew>, Serializable
WhatsNewComparator
See Also:
  • Constructor Details

    • WhatsNewComparator

      public WhatsNewComparator(int nOrder, boolean bIsAscSort)
      Constructor
      Parameters:
      nOrder - order
      bIsAscSort - true if it is sorted asc, false otherwise
  • Method Details

    • compare

      public int compare(IWhatsNew w1, IWhatsNew w2)
      Compare two WhatsNew
      Specified by:
      compare in interface Comparator<IWhatsNew>
      Parameters:
      w1 - WhatsNew 1
      w2 - WhatsNew 2
      Returns:
      in the ascending sort :
      • < 0 if w1 is before w2
      • 0 if w1 equals w2
      • > 0 if w1 is after w2