Interface ResourceSorter


  • public interface ResourceSorter
    Service to sort Resources 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 given resources by the given column 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 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
        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