src/main/java/com/theoryinpractise/halbuilder5/ResourceRepresentation.java
public ResourceRepresentation<V> withLink(Link link) {
    String rel = Links.getRel(link);
    Support.checkRelType(rel);
    validateSingletonRel(rel);
    final TreeMap<String, Rel> updatedRels =
        !rels.containsKey(rel) ? rels.put(rel, Rels.natural(rel)) : rels;
    final List<Link> updatedLinks = links.append(link);
    return new ResourceRepresentation<>(
        content, updatedLinks, updatedRels, namespaceManager, value, resources);
  }
public ResourceRepresentation<V> withLink(Link link) {
    String rel = Links.getRel(link);
    Support.checkRelType(rel);
    validateSingletonRel(rel);
    final TreeMap<String, Rel> updatedRels =
        !rels.containsKey(rel) ? rels.put(rel, Rels.natural(rel)) : rels;
    final List<Link> updatedLinks = links.append(link);
    return new ResourceRepresentation<>(
        content, updatedLinks, updatedRels, namespaceManager, value, resources);
  }
public ResourceRepresentation < V > withLink ( Link link ) { String rel = Links . getRel ( link ) ; Support . checkRelType ( rel ) ; validateSingletonRel ( rel ) ; final TreeMap < String , Rel > updatedRels = ! rels . containsKey ( rel ) ? rels . put ( rel , Rels . natural ( rel ) ) : rels ; final List < Link > updatedLinks = links . append ( link ) ; return new ResourceRepresentation <> ( content , updatedLinks , updatedRels , namespaceManager , value , resources ) ; }
Add a link to this resource.

@param link The target link
Add a link to this resource .