/** * Checks if there is a next page available for the current page. * <p/> * This method will call the service (if not already done) to read this information from the service response. * * @return <code>true</code> if {@link #next()} can be called * @throws RestClientException when an error occurred while communicating with the service */ public final boolean hasNext() throws RestClientException { loadIfNecessary(); return responseEntity.getBody().getNextLink() != null; }
/** * Returns the link to the next page of this paged resource. * * @throws RestClientException when an error occurred while communicating with the service * @throws IllegalStateException if this resource points to the last page of the collection resource */ private Link nextPageLink() throws RestClientException { Preconditions.checkState(hasNext(), "no next page available"); loadIfNecessary(); return responseEntity.getBody().getNextLink(); }
.getPreviousLink().expand(parameters).getHref()).getQuery()))); if (resources.getNextLink() != null) { model.addAttribute("pageNext", new Page((currentPage + 1), "?".concat(new URI(resources .getNextLink().expand(parameters).getHref()).getQuery())));