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 boolean
protected boolean
if this is set to true, floating items will come last in the child listprotected boolean
if this is set to true, level descriptors will come first in the child listprotected boolean
protected String
static final String
static final String
static final String
static final String
static final String
Fields 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 TypeMethodDescriptionboolean
areEqual
(ContentItemTO item1, ContentItemTO item2) int
compare
(ContentItemTO item1, ContentItemTO item2) int
hashCodeOf
(ContentItemTO item) boolean
boolean
boolean
boolean
int
secondLevelCompare
(ContentItemTO item1, ContentItemTO item2) void
setListFloatingPagesLast
(boolean listFloatingPagesLast) void
setListLevelDescriptorsFirst
(boolean listLevelDescriptorsFirst) void
setSecondLevelAscending
(boolean secondLevelAscending) void
setSecondLevelCompareRequired
(boolean secondLevelCompareReq) void
setSecondLevelSortBy
(String secondLevelSort) Methods inherited from class org.craftercms.studio.impl.v1.util.ContentComparatorBase
compareDates, compareStrings
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
-
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)
-