Class ContentItemOrderComparator
java.lang.Object
org.craftercms.studio.impl.v1.util.ContentComparatorBase<ContentItemTO>
org.craftercms.studio.impl.v1.util.ContentItemOrderComparator
- All Implemented Interfaces:
Comparator<ContentItemTO>
This class compares two DmContentItem based on their order values specified
by order name
- Author:
- hyanghee, Dejan Brkic
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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 listFields inherited from class org.craftercms.studio.impl.v1.util.ContentComparatorBase
_ascending, _sort
-
Constructor Summary
ConstructorsConstructorDescriptionContentItemOrderComparator
(String orderName, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst) constructor that sets the order name and the sort type -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(ContentItemTO item1, ContentItemTO item2) boolean
boolean
void
setListFloatingPagesLast
(boolean listFloatingPagesLast) void
setListLevelDescriptorsFirst
(boolean listLevelDescriptorsFirst) 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
-
_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
-
-
Constructor Details
-
ContentItemOrderComparator
public ContentItemOrderComparator(String orderName, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst) constructor that sets the order name and the sort type- Parameters:
orderName
-ascending
-listFloatingPagesLast
- 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 Details
-
setListFloatingPagesLast
public void setListFloatingPagesLast(boolean listFloatingPagesLast) - Parameters:
listFloatingPagesLast
- the listFloatingPagesLast to set
-
isListFloatingPagesLast
public boolean isListFloatingPagesLast()- Returns:
- the listFloatingPagesLast
-
setListLevelDescriptorsFirst
public void setListLevelDescriptorsFirst(boolean listLevelDescriptorsFirst) - Parameters:
listLevelDescriptorsFirst
- the listLevelDescriptorsFirst to set
-
isListLevelDescriptorsFirst
public boolean isListLevelDescriptorsFirst()- Returns:
- the listLevelDescriptorsFirst
-
compare
-