generator.writeNumberField("rowsPerPage", pages.getPerPage()); generator.writeNumberField("numberOfResults", pages.getNumResults()); generator.writeEndObject();
/** * Adds the specified link to the headers and body of the response. * * @param link The type of the link being added * @param pages The paginated set of results containing the pages being linked to. * @param uriBuilder The builder for creating the pagination links. * @param bodyLinks The map of links that will be added to the body of the response */ public static void addLink( PaginationLink link, Pagination<?> pages, UriBuilder uriBuilder, Map<String, URI> bodyLinks ) { link.getPage(pages).ifPresent(page -> addLink(link, page, pages.getPerPage(), uriBuilder, bodyLinks)); }
/** * Adds the specified link to the headers and body of the response. * * @param link The type of the link being added * @param pages The paginated set of results containing the pages being linked to. * @param uriBuilder The uri builder to build the links * @param responseProcessor The response processor whose links are being built * @param bodyLinks The map of links that will be added to the body of the response */ public static void addLink( PaginationLink link, Pagination<?> pages, UriBuilder uriBuilder, MappingResponseProcessor responseProcessor, Map<String, URI> bodyLinks ) { link.getPage(pages).ifPresent( page -> addLink(link, page, pages.getPerPage(), uriBuilder, responseProcessor, bodyLinks) ); }
generator.writeNumberField("rowsPerPage", pagination.getPerPage()); generator.writeNumberField("numberOfResults", pagination.getNumResults());
uriInfo.getRequestUriBuilder() .replaceQueryParam(PAGE, pair.getRight()) .replaceQueryParam(PER_PAGE, pages.getPerPage())