Adds an embedded resource or array of resources.

@param rel      the relation type
@param embedded the resource (can be an array of resources)
@return itself
542197
public HalRepresentation embedded(String rel, Object embedded) {
        this.embedded.put(rel, embedded);
        return this;
    }
80902
public static base_responses add(nitro_service client, nd6 resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			nd6 addresources[] = new nd6[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new nd6();
				addresources[i].neighbor = resources[i].neighbor;
				addresources[i].mac = resources[i].mac;
				addresources[i].ifnum = resources[i].ifnum;
				addresources[i].vlan = resources[i].vlan;
				addresources[i].td = resources[i].td;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
236003
public void createLink(HalRelation rel, String... pathParams) {
    if(pathParams != null && pathParams.length > 0 && pathParams[0] != null) {
      Set<String> linkedResourceIds = linkedResources.get(rel);
      if(linkedResourceIds == null) {
        linkedResourceIds = new HashSet<String>();
        linkedResources.put(rel, linkedResourceIds);
      }

      // Hmm... use the last id in the pathParams as linked resource id
      linkedResourceIds.add(pathParams[pathParams.length - 1]);

      resource.addLink(rel.relName, rel.uriTemplate.build((Object[])pathParams));
    }
  }
1210552
def _add_rel(self, key, rel, thing, wrap):
        
        self.o.setdefault(key, {})

        if wrap:
            self.o[key].setdefault(rel, [])

        if rel not in self.o[key]:
            self.o[key][rel] = thing
            return

        existing = self.o[key].get(rel)
        if isinstance(existing, list):
            existing.append(thing)
            return

        self.o[key][rel] = [existing, thing]
1038657
@Override
    public T addAsLibraries(File... resources) throws IllegalArgumentException {
        Validate.notNull(resources, "Resources must be specified");
        for (File resource : resources) {
            addAsLibrary(resource);
        }
        return covarientReturn();
    }
334270
def add_resource_fragment(fragment, include_related)
      init_included_relationships(fragment, include_related)

      fragment.related_from.each do |rid|
        @source_resource_id_tree.fragments[rid].add_related_identity(parent_relationship.name, fragment.identity)
      end

      @fragments[fragment.identity] = fragment
    end
998513
public void add(@Nullable Object source) {

		EmbeddedWrapper wrapper = wrappers.wrap(source);

		if (wrapper == null) {
			return;
		}

		HalLinkRelation collectionRel = getDefaultedRelFor(wrapper, true);
		HalLinkRelation collectionOrItemRel = collectionRel;

		if (!embeddeds.containsKey(collectionRel)) {
			collectionOrItemRel = getDefaultedRelFor(wrapper, wrapper.isCollectionValue());
		}

		Object currentValue = embeddeds.get(collectionOrItemRel);
		Object value = wrapper.getValue();

		if (currentValue == null && !wrapper.isCollectionValue()) {
			embeddeds.put(collectionOrItemRel, value);
			return;
		}

		List<Object> list = new ArrayList<>();
		list.addAll(asCollection(currentValue));
		list.addAll(asCollection(wrapper.getValue()));

		embeddeds.remove(collectionOrItemRel);
		embeddeds.put(collectionRel, list);
	}
418383
public function addLink(string $rel, $uri): Link
    {
        return $this->links->add($rel, $uri);
    }
264953
def add_link(self, rel, value, href=None):
        
        links_node = self.metadata.find('links')
        if links_node is None:
            links_node = ioc_et.make_links_node()
            self.metadata.append(links_node)
        link_node = ioc_et.make_link_node(rel, value, href)
        links_node.append(link_node)
        return True
651957
@SuppressWarnings("unchecked")
  public T embed(HalRelation relation, ProcessEngine processEngine) {
    List<HalResource<?>> resolvedLinks = linker.resolve(relation, processEngine);
    if(resolvedLinks != null && resolvedLinks.size() > 0) {
      addEmbedded(relation.relName, resolvedLinks);
    }
    return (T) this;
  }
658838
public Impl embedded(CharSequence ref, Resource resource) {
        if (StringUtils.isNotEmpty(ref) && resource != null) {
            List<Resource> resources = this.embeddedMap.computeIfAbsent(ref, charSequence -> new ArrayList<>());
            resources.add(resource);
        }
        return (Impl) this;
    }
459157
public function addLink($url, $rel, array $params = array())
    {
        $values = array("<{$url}>", "rel=\"{$rel}\"");

        foreach ($params as $k => $v) {
            $values[] = "{$k}=\"{$v}\"";
        }

        return $this->add(implode('; ', $values));
    }
1074559
public static Link link(String href, String rel) {
        return link(href, rel, null, null, null);
    }
1275746
public CoreGraphAlgorithms init(String label, String rel)  {
        TokenRead token = ktx.tokenRead();
        int labelId = token.nodeLabel(label);
        int relTypeId = token.relationshipType(rel);
        loadNodes(labelId, relTypeId);
        loadRels(labelId, relTypeId);
        return this;
    }
533528
def get_embedded_resource(method)
      return @_embedded[method] if @_embedded.key?(method)
      @_embedded[method] = @_definition['_embedded'][method]

      if @_embedded[method].kind_of?(Array)
        @_embedded[method].tap do |ary|
          ary.map!{ |definition| new_resource(definition, true) } unless ary.first.kind_of?(self.class)
        end
      else
        @_embedded[method] = new_resource(@_embedded[method], true)
      end
    end
590169
public List<Link> collectLinks(String rel) {
    return collectResources(Link.class, HalResourceType.LINKS, rel);
  }
388458
private function getRelationIri($rel): string
    {
        if (!(\is_array($rel) || \is_string($rel))) {
            throw new UnexpectedValueException('Expected relation to be an IRI or array');
        }

        return \is_string($rel) ? $rel : $rel['_links']['self']['href'];
    }