Add links to the HalRepresentation.
<p>
Links are only added if they are not {@link Link#isEquivalentTo(Link) equivalent}
to already existing links.
</p>
@param links links that are added to this HalRepresentation
@return this
358735
protected HalRepresentation add(final Links links) {
        this.links = this.links != null
                ? copyOf(this.links).with(links).build()
                : links.using(this.curies);
        if (embedded != null) {
            embedded = embedded.using(this.curies);
        }
        return this;
    }
262455
public void updateLinks(ServiceReference<S> serviceReference) {
        for (D declaration : linkerManagement.getMatchedDeclaration()) {
            boolean isAlreadyLinked = declaration.getStatus().getServiceReferencesBounded().contains(serviceReference);
            boolean canBeLinked = linkerManagement.canBeLinked(declaration, serviceReference);
            if (isAlreadyLinked && !canBeLinked) {
                linkerManagement.unlink(declaration, serviceReference);
            } else if (!isAlreadyLinked && canBeLinked) {
                linkerManagement.link(declaration, serviceReference);
            }
        }
    }
845745
public Map<String, String> getLinks() {
        if (links == null) {
            return ImmutableMap.of();
        }
        return ImmutableMap.copyOf(links);
    }
1158872
public HalCuriAugmenter augment(HalResource hal) {

    Set<String> existingCurieNames = getExistingCurieNames(hal);
    Set<Link> curieLinks = getCuriLinks(hal, existingCurieNames);
    hal.addLinks(LINK_RELATION_CURIES, curieLinks);
    return this;

  }
634474
public Impl link(@Nullable CharSequence ref, @Nullable Link link) {
        if (StringUtils.isNotEmpty(ref) && link != null) {
            List<Link> links = this.linkMap.computeIfAbsent(ref, charSequence -> new ArrayList<>());
            links.add(link);
        }
        return (Impl) this;
    }
1159791
synchronized Link[] links() {
        Link[] ret = null;
        if (count != 0) {
            ret = new Link[count];
            System.arraycopy(links, 0, ret, 0, count);
        }
        return ret;
    }
1246694
HalRepresentation mergeWithEmbedding(final Curies curies) {
        this.curies = this.curies.mergeWith(curies);
        if (this.links != null) {

            removeDuplicateCuriesFromEmbedding(curies);

            this.links = this.links.using(this.curies);
            if (embedded != null) {
                embedded = embedded.using(this.curies);
            }
        } else {
            if (embedded != null) {
                embedded = embedded.using(curies);
            }
        }
        return this;
    }
1322211
public void setLinks(Collection<Link> links) {
        Collection<com.ibm.ws.repository.transport.model.Link> attachmentLinks = new ArrayList<com.ibm.ws.repository.transport.model.Link>();
        for (Link link : links) {
            attachmentLinks.add(link.getLink());
        }

        _asset.getWlpInformation().setLinks(attachmentLinks);
    }
492180
public static DefaultListOperation<AssetFileInfo> list(
            LinkInfo<AssetFileInfo> link) {
        return new DefaultListOperation<AssetFileInfo>(link.getHref(),
                new GenericType<ListResult<AssetFileInfo>>() {
                });
    }
258605
private void addSelfToAtoms() {
		List<Bond> bonds = atomA.getBonds();
		if (bonds==null) {
			bonds = new ArrayList<Bond>(AtomImpl.BONDS_INITIAL_CAPACITY);
			atomA.setBonds(bonds);
		}

		boolean exists = false;
		for (Bond bond : bonds) {
			// TODO is it equals() what we want here, or is it == ? - JD 2016-03-02
			if (bond.getOther(atomA).equals(atomB)) {
				exists = true;
				break;
			}
		}
		if (!exists) {
			atomA.addBond(this);
			atomB.addBond(this);
		}
	}
607641
public void setResourceLinks(java.util.Collection<String> resourceLinks) {
        if (resourceLinks == null) {
            this.resourceLinks = null;
            return;
        }

        this.resourceLinks = new java.util.ArrayList<String>(resourceLinks);
    }
1059083
public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, TypeElement typeElement, Content contentTree) {
        addPreQualifiedClassLink(context, typeElement, false, contentTree);
    }
1132923
public synchronized final void append(Link link)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "append");

        Link prev = _dummyTail._getPreviousLink();
        link._link(prev, _dummyTail, _nextPositionToIssue++, this);
        prev._setNextLink(link);
        _dummyTail._setPreviousLink(link);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "append", _debugString());
    }
977052
public void addUrlMappings(String... urlMappings) {
		Assert.notNull(urlMappings, "UrlMappings must not be null");
		this.urlMappings.addAll(Arrays.asList(urlMappings));
	}
1060079
@SuppressWarnings("unchecked")
    @Internal
    protected final void setLinks(Map<String, Object> links) {
        for (Map.Entry<String, Object> entry : links.entrySet()) {
            String name = entry.getKey();
            Object value = entry.getValue();
            if (value instanceof Map) {
                Map<String, Object> linkMap = (Map<String, Object>) value;
                link(name, linkMap);
            }
        }
    }
1244218
protected void addLinksForIndexes(Content contentTree) {
        for (int i = 0; i < indexElements.size(); i++) {
            int j = i + 1;
            contentTree.addContent(getHyperLink(DocPaths.indexN(j),
                    new StringContent(indexElements.get(i).toString())));
            contentTree.addContent(Contents.SPACE);
        }
    }
849990
public HttpHeaders add(HttpHeaders headers) {
        if (headers == null) {
            throw new NullPointerException("headers");
        }
        for (Map.Entry<String, String> e: headers) {
            add(e.getKey(), e.getValue());
        }
        return this;
    }