#671 - Polishing.

Introduced Link.hasRel(…) and use that to filter link lookups in ResourceSupport.
This commit is contained in:
Oliver Gierke
2017-11-29 12:00:02 +01:00
parent d40bda2337
commit 79ebf9b5a4
3 changed files with 39 additions and 2 deletions

View File

@@ -168,6 +168,19 @@ public class Link implements Serializable {
return new Link(getUriTemplate().expand(arguments).toString(), getRel());
}
/**
* Returns whether the current {@link Link} has the given link relation.
*
* @param rel must not be {@literal null} or empty.
* @return
*/
public boolean hasRel(String rel) {
Assert.hasText(rel, "Link relation must not be null or empty!");
return this.rel.equals(rel);
}
private UriTemplate getUriTemplate() {
if (template == null) {