#11 - Revert to List for links in ResourceSupport.

The order of the links needs to be stable across different requests. Thus we have to revert to List instead of a Set.
This commit is contained in:
Oliver Gierke
2012-09-12 12:51:28 +02:00
parent fc4eebd128
commit acdb0c8a5b

View File

@@ -15,9 +15,9 @@
*/ */
package org.springframework.hateoas; package org.springframework.hateoas;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.List;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@@ -34,10 +34,10 @@ public class ResourceSupport implements Identifiable<Link> {
@XmlElement(name = "link", namespace = Link.ATOM_NAMESPACE) @XmlElement(name = "link", namespace = Link.ATOM_NAMESPACE)
@JsonProperty("links") @JsonProperty("links")
private final Set<Link> links; private final List<Link> links;
public ResourceSupport() { public ResourceSupport() {
this.links = new HashSet<Link>(); this.links = new ArrayList<Link>();
} }
/** /**
@@ -94,8 +94,8 @@ public class ResourceSupport implements Identifiable<Link> {
* *
* @return * @return
*/ */
public Set<Link> getLinks() { public List<Link> getLinks() {
return Collections.unmodifiableSet(links); return Collections.unmodifiableList(links);
} }
/** /**