Permalink
Browse files

#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.
  • Loading branch information...
1 parent fc4eebd commit acdb0c8a5b8df65cdb1dea5ea94f4e81c5d1087b @olivergierke olivergierke committed Sep 12, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/main/java/org/springframework/hateoas/ResourceSupport.java
@@ -15,9 +15,9 @@
*/
package org.springframework.hateoas;
+import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -34,10 +34,10 @@
@XmlElement(name = "link", namespace = Link.ATOM_NAMESPACE)
@JsonProperty("links")
- private final Set<Link> links;
+ private final List<Link> links;
public ResourceSupport() {
- this.links = new HashSet<Link>();
+ this.links = new ArrayList<Link>();
}
/**
@@ -94,8 +94,8 @@ public boolean hasLink(String rel) {
*
* @return
*/
- public Set<Link> getLinks() {
- return Collections.unmodifiableSet(links);
+ public List<Link> getLinks() {
+ return Collections.unmodifiableList(links);
}
/**

0 comments on commit acdb0c8

Please sign in to comment.