/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
@Override public Set<Link> getLinks() { return super.getLinks() .stream() .map(link -> { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); }) .collect(Collectors.toSet()); }
@Override public Set<Link> getLinks() { return super.getLinks() .stream() .map(link -> { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); }) .collect(Collectors.toSet()); }
@Override public Set<Link> getLinks() { return super.getLinks() .stream() .map(link -> { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); }) .collect(Collectors.toSet()); }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
@Override public Set<Link> getLinks() { return Sets.newHashSet(Collections2.transform(super.getLinks(), new Function<Link, Link>() { @Override public Link apply(Link link) { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); } })); }
@Override public Set<Link> getLinks() { return Sets.newHashSet(Collections2.transform(super.getLinks(), new Function<Link, Link>() { @Override public Link apply(Link link) { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); } })); }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
/** * Get the link for the relation. * * @param relation link relation. * @return the link for the relation, otherwise {@code null} if not present. */ public Link getLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return link; } } return null; }
@Override public Set<Link> getLinks() { return Sets.newHashSet(Collections2.transform(super.getLinks(), new Function<Link, Link>() { @Override public Link apply(Link link) { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); } })); }
/** * Check if link for relation exists. * * @param relation link relation. * @return {@code true} if the for the relation link exists, {@code false} * otherwise. */ public boolean hasLink(String relation) { for (Link link : getLinks()) { List<String> relations = LinkProvider.getLinkRelations(link.getRel()); if (relations != null && relations.contains(relation)) { return true; } } return false; }
@Override public Set<Link> getLinks() { return super.getLinks() .stream() .map(link -> { if (link.getUri().isAbsolute()) { return link; } return Link.fromLink(link).baseUri(getResolvedRequestUri()).build(); }) .collect(Collectors.toSet()); }