#267 - Added ResourceSupport.add(Link... links).

This commit is contained in:
Kellen Dye
2014-12-04 09:24:47 +01:00
committed by Oliver Gierke
parent 6f61126989
commit bc0737361c

View File

@@ -16,6 +16,7 @@
package org.springframework.hateoas;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -68,6 +69,16 @@ public class ResourceSupport implements Identifiable<Link> {
}
}
/**
* Adds all given {@link Link}s to the resource.
*
* @param links must not be {@literal null}.
*/
public void add(Link... links) {
Assert.notNull(links, "Given links must not be null!");
add(Arrays.asList(links));
}
/**
* Returns whether the resource contains {@link Link}s at all.
*