From dab25f25fc1914265af445324c2f8ca6d54fd6fb Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 28 Aug 2012 18:28:21 +0200 Subject: [PATCH] Resources - Switched from Collection to Iterable for source content. --- src/main/java/org/springframework/hateoas/Resources.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/hateoas/Resources.java b/src/main/java/org/springframework/hateoas/Resources.java index c3f87c14..c0ad1816 100644 --- a/src/main/java/org/springframework/hateoas/Resources.java +++ b/src/main/java/org/springframework/hateoas/Resources.java @@ -53,7 +53,7 @@ public class Resources extends ResourceSupport implements Iterable { * @param content must not be {@literal null}. * @param links the links to be added to the {@link Resources}. */ - public Resources(Collection content, Link... links) { + public Resources(Iterable content, Link... links) { this(content, Arrays.asList(links)); } @@ -63,12 +63,15 @@ public class Resources extends ResourceSupport implements Iterable { * @param content must not be {@literal null}. * @param links the links to be added to the {@link Resources}. */ - public Resources(Collection content, Iterable links) { + public Resources(Iterable content, Iterable links) { Assert.notNull(content); this.content = new ArrayList(); - this.content.addAll(content); + + for (T element : content) { + this.content.add(element); + } this.add(links); }