Class DmContentItemComparator

java.lang.Object
org.craftercms.studio.impl.v1.util.ContentComparatorBase<ContentItemTO>
org.craftercms.studio.api.v1.util.DmContentItemComparator
All Implemented Interfaces:
Comparator<ContentItemTO>

public class DmContentItemComparator extends ContentComparatorBase<ContentItemTO>
  • Field Details

    • SORT_EVENT_DATE

      public static final String SORT_EVENT_DATE
      See Also:
    • SORT_INTERNAL_NAME

      public static final String SORT_INTERNAL_NAME
      See Also:
    • SORT_BROWSER_URI

      public static final String SORT_BROWSER_URI
      See Also:
    • SORT_PATH

      public static final String SORT_PATH
      See Also:
    • SORT_USER_LAST_NAME

      public static final String SORT_USER_LAST_NAME
      See Also:
    • _listFloatingPagesLast

      protected boolean _listFloatingPagesLast
      if this is set to true, floating items will come last in the child list
    • _listLevelDescriptorsFirst

      protected boolean _listLevelDescriptorsFirst
      if this is set to true, level descriptors will come first in the child list
    • _secondLevelSortBy

      protected String _secondLevelSortBy
    • _isSecondLevelCompareRequired

      protected boolean _isSecondLevelCompareRequired
    • _secondLevelAscending

      protected boolean _secondLevelAscending
  • Constructor Details

    • DmContentItemComparator

      public DmContentItemComparator(String sort, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst)
      constructor that sets the sort key and the sort type
      Parameters:
      sort - sort strategy
      ascending - if true order is ascending, otherwise descending
      listFloatingPagesLast - if this is set to true, floating items will come last in the child list
      listLevelDescriptorsFirst - if this is set to true, level descriptors will come first in the child list
    • DmContentItemComparator

      public DmContentItemComparator(String sort, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst, String secondLevelSortBy, boolean secLevelCompareReq, boolean secLevAscending)
  • Method Details

    • areEqual

      public boolean areEqual(ContentItemTO item1, ContentItemTO item2)
    • hashCodeOf

      public int hashCodeOf(ContentItemTO item)
    • compare

      public int compare(ContentItemTO item1, ContentItemTO item2)
    • secondLevelCompare

      public int secondLevelCompare(ContentItemTO item1, ContentItemTO item2)
    • setListFloatingPagesLast

      public void setListFloatingPagesLast(boolean listFloatingPagesLast)
    • isListFloatingPagesLast

      public boolean isListFloatingPagesLast()
    • setListLevelDescriptorsFirst

      public void setListLevelDescriptorsFirst(boolean listLevelDescriptorsFirst)
    • isListLevelDescriptorsFirst

      public boolean isListLevelDescriptorsFirst()
    • getSecondLevelSortBy

      public String getSecondLevelSortBy()
    • setSecondLevelSortBy

      public void setSecondLevelSortBy(String secondLevelSort)
    • isSecondLevelCompareRequired

      public boolean isSecondLevelCompareRequired()
    • setSecondLevelCompareRequired

      public void setSecondLevelCompareRequired(boolean secondLevelCompareReq)
    • isSecondLevelAscending

      public boolean isSecondLevelAscending()
    • setSecondLevelAscending

      public void setSecondLevelAscending(boolean secondLevelAscending)