Interface ResourceSorter


  • public interface ResourceSorter
    Service to sort Resources by a column defined in /libs/dam/gui/content/commons/availablecolumns.
    • Method Detail

      • sort

        List<Resource> sort​(Iterator<Resource> resources,
                            String column,
                            boolean reverse,
                            int limit,
                            int offset,
                            String[] filters)
        Sorts the given resources by the given column name. If reverse is true, sorting gets reversed. limit and offset define the range getting returned.
        Parameters:
        resources - Resources to sort
        column - Column used as sort criteria
        reverse - If true result gets reversed
        limit - Max number of resources to return
        offset - Number of first resources not to return
        filters - 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