@Component public class PaginationServiceImpl extends Object implements PaginationService
Constructor and Description |
---|
PaginationServiceImpl(LinkService linkService) |
Modifier and Type | Method and Description |
---|---|
<T extends AbstractRestModel> |
getExpandablePage(PageRequest pageRequest,
javax.ws.rs.core.UriInfo uriInfo,
String pageLocation)
Constructs a
RestPageModel which is an empty page with a self link. |
<W,T extends AbstractRestModel> |
getPage(Iterable<W> input,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo,
RestConversionFunction<? super W,T> transformer)
Transforms a list of domain objects to
AbstractRestModel s and constructs a RestPageModel from the
result. |
<W,T extends AbstractRestModel> |
getPage(Iterable<W> input,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo,
RestConversionFunction<? super W,T> transformer,
String pageLocation)
Transforms a list of domain objects to
AbstractRestModel s and constructs a RestPageModel from the
result. |
<W,T extends AbstractRestModel> |
getPage(Stream<W> input,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo,
RestConversionFunction<? super W,T> transformer)
Transforms a list of domain objects to
AbstractRestModel s and constructs a RestPageModel from the
result. |
<W,T extends AbstractRestModel> |
getPage(Stream<W> input,
PageRequest pageRequest,
Expansion expansion,
javax.ws.rs.core.UriInfo uriInfo,
RestConversionFunction<? super W,T> transformer,
String pageLocation)
Transforms a list of domain objects to
AbstractRestModel s and constructs a RestPageModel from the
result. |
@Autowired public PaginationServiceImpl(LinkService linkService)
@NotNull public <W,T extends AbstractRestModel> RestPageModel<T> getPage(@NotNull Iterable<W> input, @NotNull PageRequest pageRequest, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull RestConversionFunction<? super W,T> transformer)
PaginationService
Transforms a list of domain objects to AbstractRestModel
s and constructs a RestPageModel
from the
result. Assumes input is the full list of possible objects. Will only transform the required number of objects as
defined by the PageRequest
. The RestPageModel
will include page links.
DO NOT USE FOR EXPANDED PAGES
This method assumes the uriInfo represents the page being requested and uses it to construct the page's self
link. Use PaginationService.getPage(Iterable, PageRequest, Expansion, UriInfo, RestConversionFunction, String)
to specify
the page location if the current request does not represent the page being transformed (e.g. resource expansion
may need to construct a page of sub-resources).
getPage
in interface PaginationService
W
- domain objectT
- rest objectinput
- full list of domain objectspageRequest
- which page of information requiredexpansion
- The expansion to use when transforming the objectsuriInfo
- URI info from the request used to construct the page's self linktransformer
- to convert domain object into rest object@NotNull public <W,T extends AbstractRestModel> RestPageModel<T> getPage(@NotNull Stream<W> input, @NotNull PageRequest pageRequest, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull RestConversionFunction<? super W,T> transformer)
PaginationService
Transforms a list of domain objects to AbstractRestModel
s and constructs a RestPageModel
from the
result. Assumes input is the full list of possible objects. Will only transform the required number of objects as
defined by the PageRequest
. The RestPageModel
will include page links.
DO NOT USE FOR EXPANDED PAGES
This method assumes the uriInfo represents the page being requested and uses it to construct the page's self
link. Use PaginationService.getPage(Iterable, PageRequest, Expansion, UriInfo, RestConversionFunction, String)
to specify
the page location if the current request does not represent the page being transformed (e.g. resource expansion
may need to construct a page of sub-resources).
getPage
in interface PaginationService
W
- domain objectT
- rest objectinput
- full list of domain objectspageRequest
- which page of information requiredexpansion
- The expansion to use when transforming the objectsuriInfo
- URI info from the request used to construct the page's self linktransformer
- to convert domain object into rest object@NotNull public <W,T extends AbstractRestModel> RestPageModel<T> getPage(@NotNull Iterable<W> input, @NotNull PageRequest pageRequest, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull RestConversionFunction<? super W,T> transformer, @NotNull String pageLocation)
PaginationService
AbstractRestModel
s and constructs a RestPageModel
from the
result. Assumes input is the full list of possible objects. Will only transform the required number of objects as
defined by the PageRequest
. The RestPageModel
will include page links.getPage
in interface PaginationService
W
- domain objectT
- rest objectinput
- full list of domain objectspageRequest
- which page of information requiredexpansion
- The expansion to use when transforming the objectsuriInfo
- URI info from the requesttransformer
- to convert domain object into rest objectpageLocation
- The relative URI path used to construct the page's self link@NotNull public <W,T extends AbstractRestModel> RestPageModel<T> getPage(@NotNull Stream<W> input, @NotNull PageRequest pageRequest, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull RestConversionFunction<? super W,T> transformer, @NotNull String pageLocation)
PaginationService
AbstractRestModel
s and constructs a RestPageModel
from the
result. Assumes input is the full list of possible objects. Will only transform the required number of objects as
defined by the PageRequest
. The RestPageModel
will include page links.getPage
in interface PaginationService
W
- domain objectT
- rest objectinput
- full list of domain objectspageRequest
- which page of information requiredexpansion
- The expansion to use when transforming the objectsuriInfo
- URI info from the requesttransformer
- to convert domain object into rest objectpageLocation
- The relative URI path used to construct the page's self link@NotNull public <T extends AbstractRestModel> RestPageModel<T> getExpandablePage(@NotNull PageRequest pageRequest, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String pageLocation)
PaginationService
RestPageModel
which is an empty page with a self link.getExpandablePage
in interface PaginationService
T
- rest objectpageRequest
- which page of information requireduriInfo
- URI info from the requestpageLocation
- The relative URI path used to construct the page's self linkCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.