Package pro.taskana.common.rest
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 Summary
Constructors Constructor Description QuerySortParameter(List<S> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Voidapply(Q query)List<pro.taskana.common.api.BaseQuery.SortDirection>getOrder()List<S>getSortBy()Sort the result by a given field.static <T> voidverifyAmountOfSortByAndOrderByMatches(List<T> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order)static <T> voidverifyNotOnlyOrderByExists(List<T> sortBy, List<pro.taskana.common.api.BaseQuery.SortDirection> order)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface pro.taskana.common.rest.QueryParameter
extractTimeIntervals, wrapElementsInLikeStatement
-
-
-
-
Method Detail
-
apply
public Void apply(Q query)
- Specified by:
applyin interfaceQueryParameter<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()
-
-