/** * Retrieves the first link with the supplied {@code rel} and/or {@code type} * value. * <p> * If either parameter is {@code null}, doesn't return matches for that * parameter. */ public Link getLink(String rel, String type) { for (Link link : getLinks()) { if (link.matches(rel, type)) { return link; } } return null; }
/** * Retrieves the first link with the supplied {@code rel} and/or {@code type} * value. * <p> * If either parameter is {@code null}, doesn't return matches for that * parameter. */ public Link getLink(String rel, String type) { for (Link link : getLinks()) { if (link.matches(rel, type)) { return link; } } return null; }
/** * Retrieves the first link with the supplied {@code rel} and/or {@code type} * value. * <p> * If either parameter is {@code null}, doesn't return matches for that * parameter. */ public Link getLink(String rel, String type) { for (Link link : getLinks()) { if (link.matches(rel, type)) { return link; } } return null; }
/** * Return the links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. * @return matching links. */ public List<Link> getLinks(String relToMatch, String typeToMatch) { List<Link> result = new ArrayList<Link>(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { result.add(link); } } return result; }
/** * Return the links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. * @return matching links. */ public List<Link> getLinks(String relToMatch, String typeToMatch) { List<Link> result = new ArrayList<Link>(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { result.add(link); } } return result; }
/** * Return the links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. * @return matching links. */ public List<Link> getLinks(String relToMatch, String typeToMatch) { List<Link> result = new ArrayList<Link>(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { result.add(link); } } return result; }
/** * Remove all links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public void removeLinks(String relToMatch, String typeToMatch) { List<Link> toRemove = Lists.newArrayList(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { toRemove.add(link); } } for (Link link : toRemove) { removeLink(link); } }
/** * Remove all links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public void removeLinks(String relToMatch, String typeToMatch) { List<Link> toRemove = Lists.newArrayList(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { toRemove.add(link); } } for (Link link : toRemove) { removeLink(link); } }
/** * Remove all links that match the given {@code rel} and {@code type} values. * * @param relToMatch {@code rel} value to match or {@code null} to match any * {@code rel} value. * @param typeToMatch {@code type} value to match or {@code null} to match any * {@code type} value. */ public void removeLinks(String relToMatch, String typeToMatch) { List<Link> toRemove = Lists.newArrayList(); for (Link link : getLinks()) { if (link.matches(relToMatch, typeToMatch)) { toRemove.add(link); } } for (Link link : toRemove) { removeLink(link); } }