From 0b15928dd66f537eb64e35bebfaa142bdca81429 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 19 Jul 2012 13:17:12 +0200 Subject: [PATCH] Javadoc polishing. --- .../hateoas/ResourceSupport.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/org/springframework/hateoas/ResourceSupport.java b/src/main/java/org/springframework/hateoas/ResourceSupport.java index 60db627c..d8b17ef4 100755 --- a/src/main/java/org/springframework/hateoas/ResourceSupport.java +++ b/src/main/java/org/springframework/hateoas/ResourceSupport.java @@ -54,6 +54,11 @@ public class ResourceSupport implements Identifiable { this.links.add(link); } + /** + * Adds all given {@link Link}s to the resource. + * + * @param links + */ public void add(Iterable links) { Assert.notNull(links, "Given links must not be null!"); for (Link candidate : links) { @@ -61,14 +66,30 @@ public class ResourceSupport implements Identifiable { } } + /** + * Returns whether the resource contains {@link Link}s at all. + * + * @return + */ public boolean hasLinks() { return !this.links.isEmpty(); } + /** + * Returns whether the resource contains a {@link Link} with the given rel. + * + * @param rel + * @return + */ public boolean hasLink(String rel) { return getLink(rel) != null; } + /** + * Returns all {@link Link}s contained in this resource. + * + * @return + */ public List getLinks() { return Collections.unmodifiableList(links); }