Replaced Resource(s)Processor with ResourceEnricher.

This commit is contained in:
Oliver Gierke
2012-08-23 00:08:51 +02:00
parent 6c368faa0e
commit 2c5dfc12f6
4 changed files with 17 additions and 46 deletions

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.hateoas;
import java.util.Arrays;
import org.codehaus.jackson.annotate.JsonUnwrapped;
import org.springframework.util.Assert;
@@ -39,11 +41,13 @@ public class Resource<T> extends ResourceSupport {
* Creates a new {@link Resource} with the given content.
*
* @param content must not be {@literal null}.
* @param links the links to add to the {@link Resource}.
*/
public Resource(T content) {
public Resource(T content, Link... links) {
Assert.notNull(content, "Content must not be null!");
this.content = content;
this.add(Arrays.asList(links));
}
/**