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 Comparator<Resource>getComparator(String column)Return a comparator for the given column that sorts ascending.List<Resource>sort(Iterator<Resource> resources, String column, boolean reverse, int limit, int offset, String[] filters)Sorts the givenresourcesby the givencolumnname.
-
-
-
Method Detail
-
sort
List<Resource> sort(Iterator<Resource> resources, String column, boolean reverse, int limit, int offset, 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 Comparator<Resource> getComparator(@Nullable 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
-
-