Class QuerySortParameter<Q extends pro.taskana.common.api.BaseQuery<?,?>,S extends QuerySortBy<Q>>

java.lang.Object
pro.taskana.common.rest.QuerySortParameter<Q,S>
All Implemented Interfaces:
QueryParameter<Q,Void>
Direct Known Subclasses:
ClassificationController.ClassificationQuerySortParameter, TaskCommentController.TaskCommentQuerySortParameter, TaskController.TaskQuerySortParameter, WorkbasketAccessItemController.WorkbasketAccessItemQuerySortParameter, WorkbasketController.WorkbasketQuerySortParameter

public class QuerySortParameter<Q extends pro.taskana.common.api.BaseQuery<?,?>,S extends QuerySortBy<Q>> extends Object implements QueryParameter<Q,Void>
  • Constructor Details

    • QuerySortParameter

      public QuerySortParameter(List<S> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
  • Method Details

    • apply

      public Void apply(Q query)
      Specified by:
      apply in interface QueryParameter<Q extends pro.taskana.common.api.BaseQuery<?,?>,S extends QuerySortBy<Q>>
    • verifyAmountOfSortByAndOrderByMatches

      public static <T> void verifyAmountOfSortByAndOrderByMatches(List<T> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • verifyNotOnlyOrderByExists

      public static <T> void verifyNotOnlyOrderByExists(List<T> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order) throws pro.taskana.common.api.exceptions.InvalidArgumentException
      Throws:
      pro.taskana.common.api.exceptions.InvalidArgumentException
    • getSortBy

      public List<S> getSortBy()
      Sort the result by a given field. Multiple sort values can be declared. When the primary sort value is the same, the second one will be used.
      Returns:
      the sort values
    • getOrder

      public List<pro.taskana.common.api.BaseQuery.SortDirection> getOrder()