Closed
Description
Links in a ResourceSupport class are stored in an ArrayList, this makes it possible to hold several links with the same 'rel' with different hrefs. If I call the method getLink(rel), only the first matching entry is returned.
public Link getLink(String rel) {
for (Link link : links) {
if (link.getRel().equals(rel)) {
return link;
}
}
return null;
}
On client side the produced JSON looks like a multi valued map with one or more entries for one rel.
Wouldn't it be better to use such a map in the ResourceSupport class itself to keep consistency?