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 Summary
Fields Modifier and Type Field Description protected boolean
_isSecondLevelCompareRequired
protected boolean
_listFloatingPagesLast
if this is set to true, floating items will come last in the child listprotected boolean
_listLevelDescriptorsFirst
if this is set to true, level descriptors will come first in the child listprotected boolean
_secondLevelAscending
protected String
_secondLevelSortBy
static String
SORT_BROWSER_URI
static String
SORT_EVENT_DATE
static String
SORT_INTERNAL_NAME
static String
SORT_PATH
static String
SORT_USER_LAST_NAME
-
Fields inherited from class org.craftercms.studio.impl.v1.util.ContentComparatorBase
_ascending, _sort, serialVersionUID
-
-
Constructor Summary
Constructors Constructor Description DmContentItemComparator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areEqual(ContentItemTO item1, ContentItemTO item2)
int
compare(ContentItemTO item1, ContentItemTO item2)
String
getSecondLevelSortBy()
int
hashCodeOf(ContentItemTO item)
boolean
isListFloatingPagesLast()
boolean
isListLevelDescriptorsFirst()
boolean
isSecondLevelAscending()
boolean
isSecondLevelCompareRequired()
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 Detail
-
SORT_EVENT_DATE
public static final String SORT_EVENT_DATE
- See Also:
- Constant Field Values
-
SORT_INTERNAL_NAME
public static final String SORT_INTERNAL_NAME
- See Also:
- Constant Field Values
-
SORT_BROWSER_URI
public static final String SORT_BROWSER_URI
- See Also:
- Constant Field Values
-
SORT_PATH
public static final String SORT_PATH
- See Also:
- Constant Field Values
-
SORT_USER_LAST_NAME
public static final String SORT_USER_LAST_NAME
- See Also:
- Constant Field Values
-
_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 Detail
-
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
-
-
Method Detail
-
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)
-
-