Class ApiRequestConverter
- Author:
- Thiago A. de Souza Weber
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.Pageable
convert
(com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest) Convert anApiPageRequest
toPageable
object.static org.springframework.data.domain.Pageable
convert
(com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest, com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiPageRequest
andApiSortRequest
toPageable
object.static org.springframework.data.domain.Sort
convert
(com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiSortRequest
toPageable
object.
-
Method Details
-
convert
public static org.springframework.data.domain.Pageable convert(@Nullable com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest) Convert anApiPageRequest
toPageable
object.In cases where the given
ApiPageRequest
is invalid, its is return the first page to be requested, with defaults specified by the TOTVS API Guideline.Note:
Pageable
iszero
indexed, whileApiPageRequest
isone
indexed. Thus the page number provided by theApiPageRequest
is always decremented by1
to be compatible withPageable
.- Parameters:
apiPageRequest
- page specification by the TOTVS API Guideline- Returns:
- a page to be requested
- See Also:
-
ApiPageRequest
Pageable
-
convert
public static org.springframework.data.domain.Pageable convert(@Nullable com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest, @Nullable com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiPageRequest
andApiSortRequest
toPageable
object.In cases where the given
ApiPageRequest
is invalid, its is return the first page to be requested, with defaults specified by the TOTVS API Guideline.Like the
ApiPageRequest
, when theApiSortRequest
is invalid, the page definition is create withunsorted
instruction.Note:
Pageable
iszero
indexed, whileApiPageRequest
isone
indexed. Thus the page number provided by theApiPageRequest
is always decremented by1
to be compatible withPageable
.- Parameters:
apiPageRequest
- page specification by the TOTVS API GuidelineapiSortRequest
- sort specification by the TOTVS API Guideline- Returns:
- a page to be requested with possible sort instructions
- See Also:
-
ApiPageRequest
ApiSortRequest
Pageable
Sort
-
convert
public static org.springframework.data.domain.Sort convert(@Nullable com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiSortRequest
toPageable
object.In cases where the given
ApiSortRequest
is invalid, the page definition is create withunsorted
instruction.- Parameters:
apiSortRequest
- sort specification by the TOTVS API Guideline- Returns:
- a sort instruction to be applied to the query
- See Also:
-
ApiSortRequest
Sort
-