Package com.day.cq.dam.commons.sort
Interface ResourceSorter
-
public interface ResourceSorterService to sortResources 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 givenresourcesby the givencolumnname.
-
-
-
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 givenresourcesby the givencolumnname. Ifreverseis true, sorting gets reversed.limitandoffsetdefine 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
-
-