Skip to content

"Get Link functionality" of ResourceSupport class #542

Closed
@6pet6ter6

Description

@6pet6ter6

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions