/** * Returns the Link pointing to the next page (if set). * * @return */ @JsonIgnore public Optional<Link> getNextLink() { return getLink(IanaLinkRelation.NEXT.value()); }
if (hasFirst && resources.getLink("first") != null) { model.addAttribute("pageFirst", new Page(1, "?".concat(new URI(resources .getLinks("first").get(0).expand(parameters).getHref()).getQuery()))); if (hasLast && resources.getLink("last") != null) { model.addAttribute("pageLast", new Page(totalPages, "?".concat(new URI(resources .getLinks("last").get(0).expand(parameters).getHref()).getQuery())));
/** * Returns the Link pointing to the previous page (if set). * * @return */ @JsonIgnore public Optional<Link> getPreviousLink() { return getLink(IanaLinkRelation.PREV.value()); }
/** * Returns the Link pointing to the previous page (if set). * * @return */ @JsonIgnore public Link getPreviousLink() { return getLink(Link.REL_PREVIOUS); }
/** * Returns the Link pointing to the next page (if set). * * @return */ @JsonIgnore public Link getNextLink() { return getLink(Link.REL_NEXT); }
private void writeRelLink(PagedResources value, JsonGenerator jgen, String rel, String hydraPredicate) throws IOException { Link link = value.getLink(rel); if (link != null) { jgen.writeStringField("hydra:" + hydraPredicate, link.getHref()); } }
@Override public PagedResources<Resource<Address>> process(PagedResources<Resource<Address>> resources) { String[] linkParts = resources.getLink("self").getHref().split("/"); String customerId = linkParts[linkParts.length - 2]; try { UUID.fromString(customerId); resources.add(linkTo(methodOn(AddressesCommandsController.class).getCommands(customerId)).withRel("commands")); } catch (Exception e) {} return resources; } }