Class SharedDFItemComparator<T extends com.im.df.api.ddl.DFItem>

  • All Implemented Interfaces:
    java.util.Comparator<T>

    public final class SharedDFItemComparator<T extends com.im.df.api.ddl.DFItem>
    extends java.lang.Object
    implements java.util.Comparator<T>
    This Comparator orders DFItems as follows:
    1. Unsharable items, and sharable items that belong to the current user
    2. Items grouped by the owner user
    Each group will be ordered according to the order of group's items as returned by DIF APIs.
    • Constructor Summary

      Constructors 
      Constructor Description
      SharedDFItemComparator​(java.util.List<T> originalOrder, com.im.df.api.ddl.DFItem el)
      Creates a Comparator, which consults the originalOrder of items.
      SharedDFItemComparator​(java.util.List<T> originalOrder, java.lang.String currentUser)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(T o1, T o2)  
      java.lang.String getCurrentUser()  
      • 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

      • SharedDFItemComparator

        public SharedDFItemComparator​(java.util.List<T> originalOrder,
                                      com.im.df.api.ddl.DFItem el)
        Creates a Comparator, which consults the originalOrder of items. The current user is taken from the DFSchema which is the parent of the DFItem el.
        Parameters:
        originalOrder - The original order
        el - The schema component.
      • SharedDFItemComparator

        public SharedDFItemComparator​(java.util.List<T> originalOrder,
                                      java.lang.String currentUser)
    • Method Detail

      • getCurrentUser

        public java.lang.String getCurrentUser()
      • compare

        public int compare​(T o1,
                           T o2)
        Specified by:
        compare in interface java.util.Comparator<T extends com.im.df.api.ddl.DFItem>