/** * Checks if there is a previous 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 #previous()} can be called * @throws RestClientException when an error occurred while communicating with the service */ public final boolean hasPrevious() throws RestClientException { loadIfNecessary(); return responseEntity.getBody().getPreviousLink() != null; }
/** * Returns the link to the previous page of this paged resource. * * @throws RestClientException when an error occurred while communicating with the service * @throws IllegalStateException if this resource points to the first page of the collection resource */ private Link previousPageLink() throws RestClientException { Preconditions.checkState(hasPrevious(), "no previous page available"); loadIfNecessary(); return responseEntity.getBody().getPreviousLink(); }
.getLinks("last").get(0).expand(parameters).getHref()).getQuery()))); if (resources.getPreviousLink() != null) { model.addAttribute("pagePrev", new Page((currentPage - 1), "?".concat(new URI(resources .getPreviousLink().expand(parameters).getHref()).getQuery())));