Resources - Make returned content Collection immutable.
This commit is contained in:
@@ -18,6 +18,7 @@ package org.springframework.hateoas;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAnyElement;
|
||||
@@ -100,7 +101,7 @@ public class Resources<T> extends ResourceSupport implements Iterable<T> {
|
||||
* @return the content will never be {@literal null}.
|
||||
*/
|
||||
public Collection<T> getContent() {
|
||||
return content;
|
||||
return Collections.unmodifiableCollection(content);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user