#9 - Added constructors taking Iterable<Link> to resource abstractions.
This commit is contained in:
@@ -41,16 +41,26 @@ public class Resource<T> extends ResourceSupport {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link Resource} with the given content.
|
||||
* Creates a new {@link Resource} with the given content and {@link Link}s (optional).
|
||||
*
|
||||
* @param content must not be {@literal null}.
|
||||
* @param links the links to add to the {@link Resource}.
|
||||
*/
|
||||
public Resource(T content, Link... links) {
|
||||
this(content, Arrays.asList(links));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link Resource} with the given content and {@link Link}s.
|
||||
*
|
||||
* @param content must not be {@literal null}.
|
||||
* @param links the links to add to the {@link Resource}.
|
||||
*/
|
||||
public Resource(T content, Iterable<Link> links) {
|
||||
|
||||
Assert.notNull(content, "Content must not be null!");
|
||||
this.content = content;
|
||||
this.add(Arrays.asList(links));
|
||||
this.add(links);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user