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>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanif this is set to true, floating items will come last in the child listprotected booleanif this is set to true, level descriptors will come first in the child listprotected booleanprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.craftercms.studio.impl.v1.util.ContentComparatorBase
_ascending, _sort, serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionDmContentItemComparator(String sort, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst) constructor that sets the sort key and the sort typeDmContentItemComparator(String sort, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst, String secondLevelSortBy, boolean secLevelCompareReq, boolean secLevAscending) -
Method Summary
Modifier and TypeMethodDescriptionbooleanareEqual(ContentItemTO item1, ContentItemTO item2) intcompare(ContentItemTO item1, ContentItemTO item2) inthashCodeOf(ContentItemTO item) booleanbooleanbooleanbooleanintsecondLevelCompare(ContentItemTO item1, ContentItemTO item2) voidsetListFloatingPagesLast(boolean listFloatingPagesLast) voidsetListLevelDescriptorsFirst(boolean listLevelDescriptorsFirst) voidsetSecondLevelAscending(boolean secondLevelAscending) voidsetSecondLevelCompareRequired(boolean secondLevelCompareReq) voidsetSecondLevelSortBy(String secondLevelSort) Methods inherited from class org.craftercms.studio.impl.v1.util.ContentComparatorBase
compareDates, compareStringsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
SORT_EVENT_DATE
- See Also:
-
SORT_INTERNAL_NAME
- See Also:
-
SORT_BROWSER_URI
- See Also:
-
SORT_PATH
- See Also:
-
SORT_USER_LAST_NAME
- See Also:
-
_listFloatingPagesLast
protected boolean _listFloatingPagesLastif this is set to true, floating items will come last in the child list -
_listLevelDescriptorsFirst
protected boolean _listLevelDescriptorsFirstif this is set to true, level descriptors will come first in the child list -
_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 strategyascending- if true order is ascending, otherwise descendinglistFloatingPagesLast- if this is set to true, floating items will come last in the child listlistLevelDescriptorsFirst- if this is set to true, level descriptors will come first in the child list
-
DmContentItemComparator
-
-
Method Details
-
areEqual
-
hashCodeOf
-
compare
-
secondLevelCompare
-
setListFloatingPagesLast
public void setListFloatingPagesLast(boolean listFloatingPagesLast) -
isListFloatingPagesLast
public boolean isListFloatingPagesLast() -
setListLevelDescriptorsFirst
public void setListLevelDescriptorsFirst(boolean listLevelDescriptorsFirst) -
isListLevelDescriptorsFirst
public boolean isListLevelDescriptorsFirst() -
getSecondLevelSortBy
-
setSecondLevelSortBy
-
isSecondLevelCompareRequired
public boolean isSecondLevelCompareRequired() -
setSecondLevelCompareRequired
public void setSecondLevelCompareRequired(boolean secondLevelCompareReq) -
isSecondLevelAscending
public boolean isSecondLevelAscending() -
setSecondLevelAscending
public void setSecondLevelAscending(boolean secondLevelAscending)
-