Package com.day.cq.dam.commons.sort
Interface ResourceSorter
-
public interface ResourceSorter
Service to sortResource
s by a column defined in /libs/dam/gui/content/commons/availablecolumns.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Comparator<Resource>
getComparator(java.lang.String column)
Return a comparator for the given column that sorts ascending.java.util.List<Resource>
sort(java.util.Iterator<Resource> resources, java.lang.String column, boolean reverse, int limit, int offset, java.lang.String[] filters)
Sorts the givenresources
by the givencolumn
name.
-
-
-
Method Detail
-
sort
java.util.List<Resource> sort(java.util.Iterator<Resource> resources, java.lang.String column, boolean reverse, int limit, int offset, java.lang.String[] filters)
Sorts the givenresources
by the givencolumn
name. Ifreverse
is true, sorting gets reversed.limit
andoffset
define the range getting returned.- Parameters:
resources
- Resources to sortcolumn
- Column used as sort criteriareverse
- If true result gets reversedlimit
- Max number of resources to returnoffset
- Number of first resources not to returnfilters
- node or mime types- Returns:
-
getComparator
@Nullable java.util.Comparator<Resource> getComparator(@Nullable java.lang.String column)
Return a comparator for the given column that sorts ascending.- Parameters:
column
- Column used as sort criteria- Returns:
- an ascending comparator for the given column
-
-