Class ApiRequestConverter
- Author:
- Thiago A. de Souza Weber
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.Pageableconvert(com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest) Convert anApiPageRequesttoPageableobject.static org.springframework.data.domain.Pageableconvert(com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest, com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiPageRequestandApiSortRequesttoPageableobject.static org.springframework.data.domain.Sortconvert(com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiSortRequesttoPageableobject.
-
Method Details
-
convert
public static org.springframework.data.domain.Pageable convert(@Nullable com.totvs.tjf.api.context.request.ApiPageRequest apiPageRequest) Convert anApiPageRequesttoPageableobject.In cases where the given
ApiPageRequestis invalid, its is return the first page to be requested, with defaults specified by the TOTVS API Guideline.Note:
Pageableiszeroindexed, whileApiPageRequestisoneindexed. Thus the page number provided by theApiPageRequestis always decremented by1to be compatible withPageable.- Parameters:
apiPageRequest- page specification by the TOTVS API Guideline- Returns:
- a page to be requested
- See Also:
-
ApiPageRequestPageable
-
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 anApiPageRequestandApiSortRequesttoPageableobject.In cases where the given
ApiPageRequestis invalid, its is return the first page to be requested, with defaults specified by the TOTVS API Guideline.Like the
ApiPageRequest, when theApiSortRequestis invalid, the page definition is create withunsortedinstruction.Note:
Pageableiszeroindexed, whileApiPageRequestisoneindexed. Thus the page number provided by theApiPageRequestis always decremented by1to 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:
-
ApiPageRequestApiSortRequestPageableSort
-
convert
public static org.springframework.data.domain.Sort convert(@Nullable com.totvs.tjf.api.context.request.ApiSortRequest apiSortRequest) Convert anApiSortRequesttoPageableobject.In cases where the given
ApiSortRequestis invalid, the page definition is create withunsortedinstruction.- Parameters:
apiSortRequest- sort specification by the TOTVS API Guideline- Returns:
- a sort instruction to be applied to the query
- See Also:
-
ApiSortRequestSort
-