Class SortMapper
java.lang.Object
org.bremersee.comparator.spring.mapper.SortMapper
This mapper provides methods to transform a
SortOrder into a Sort object from the
Spring framework (spring-data-common) and vice versa.- Author:
- Christian Bremer
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.PageableapplyDefaults(org.springframework.data.domain.Pageable source, Boolean asc, Boolean ignoreCase, Boolean nullIsFirst, String... properties) Apply defaults to page request.static org.springframework.data.domain.SortapplyDefaults(org.springframework.data.domain.Sort source, Boolean asc, Boolean ignoreCase, Boolean nullIsFirst, String... properties) Apply defaults to sort.fromSort(org.springframework.data.domain.Sort sort) Transforms aSortobject into a sort order list.static SortOrderfromSortOrder(org.springframework.data.domain.Sort.Order sortOrder) Transforms aSort.Orderobject into a sort order.static org.springframework.data.domain.SortTransforms the sort order into aSortobject.static org.springframework.data.domain.SorttoSort(SortOrders sortOrders) Transforms sort orders into aSortobject.static org.springframework.data.domain.Sort.OrdertoSortOrder(SortOrder sortOrder) Transforms the sort order into aSort.Orderobject.
-
Method Details
-
toSort
Transforms sort orders into aSortobject.- Parameters:
sortOrders- the sort orders- Returns:
- the sort
-
toSort
Transforms the sort order into aSortobject.- Parameters:
sortOrders- the sort orders- Returns:
- the sort object
-
fromSort
Transforms aSortobject into a sort order list.- Parameters:
sort- theSortobject- Returns:
- the sort order list
-
toSortOrder
Transforms the sort order into aSort.Orderobject.- Parameters:
sortOrder- the sort order- Returns:
- the sort object
-
fromSortOrder
Transforms aSort.Orderobject into a sort order.- Parameters:
sortOrder- theSort.Orderobject- Returns:
- the sort order
-
applyDefaults
public static org.springframework.data.domain.Pageable applyDefaults(org.springframework.data.domain.Pageable source, Boolean asc, Boolean ignoreCase, Boolean nullIsFirst, String... properties) Apply defaults to page request.- Parameters:
source- the sourceasc- the ascignoreCase- the ignore casenullIsFirst- the null is firstproperties- the properties- Returns:
- the pageable
-
applyDefaults
public static org.springframework.data.domain.Sort applyDefaults(org.springframework.data.domain.Sort source, Boolean asc, Boolean ignoreCase, Boolean nullIsFirst, String... properties) Apply defaults to sort.- Parameters:
source- the sourceasc- the ascignoreCase- the ignore-case flagnullIsFirst- the null is first flagproperties- the properties- Returns:
- the sort
-