Package ru.sergkorot.dynamic.util
Class SortUtils
java.lang.Object
ru.sergkorot.dynamic.util.SortUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault offset numberstatic final intDefault offset number -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.SortmakeSort(Collection<String> validNames, String sortValues) Method for getting sort orderstatic List<org.springframework.data.domain.Sort.Order>makeSortOrders(Collection<String> validNames, String sortValues) Method for getting sort order
-
Field Details
-
DEFAULT_OFFSET
public static final int DEFAULT_OFFSETDefault offset number- See Also:
-
DEFAULT_LIMIT
public static final int DEFAULT_LIMITDefault offset number- See Also:
-
-
Constructor Details
-
SortUtils
public SortUtils()
-
-
Method Details
-
makeSort
public static org.springframework.data.domain.Sort makeSort(Collection<String> validNames, String sortValues) Method for getting sort order- Parameters:
validNames- list of parameter names that match sortingsortValues- string with parameters for sorting, type: "id,-name" "-value" - sort by DESC; "value" - sort by ASC- Returns:
- Sort
-
makeSortOrders
public static List<org.springframework.data.domain.Sort.Order> makeSortOrders(Collection<String> validNames, String sortValues) Method for getting sort order- Parameters:
validNames- list of parameter names that match sortingsortValues- string with parameters for sorting, type: "id,-name" "-value" - sort by DESC; "value" - sort by ASC- Returns:
- Sort.Order - list with sorting parameters
-