/*
Adds all {@link SoftwareSystem}s that have efferent {@link com.structurizr.model.Relationship}s with the
{@link SoftwareSystem} of this {@link ContainerView}.
169789
public final void addDependentSoftwareSystems() {
        getModel().getSoftwareSystems().stream()
                .filter(softwareSystem -> softwareSystem.hasEfferentRelationshipWith(this.getSoftwareSystem()))
                .forEach(this::add);
    }
26157
@Override
    public List<org.fcrepo.server.types.gen.RelationshipTuple> getRelationships(String pid,
                                                                                String relationship) {
        LOG.debug("start: getRelationships");
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            org.fcrepo.server.storage.types.RelationshipTuple[] intRelationshipTuples =
                    null;
            intRelationshipTuples =
                    m_management.getRelationships(ReadOnlyContext
                            .getSoapContext(ctx), pid, relationship);
            return getGenRelsTuples(intRelationshipTuples);
        } catch (Throwable th) {
            LOG.error("Error getting relationships", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: getRelationships");
        }
    }
387227
protected boolean addDependencies(DependencyContainer container)
  {
    /* XXX:
    if (_classPath instanceof JarPath) {
      container.add(_depend);
      return false;
    }
    else
    */ 
    if (_hasJNIReload) {
      container.add(this);
      return true;
    }
    else if (_sourcePath == null) {
      container.add(_depend);
      return false;
    }
    else {
      container.add(this);
      return true;
    }
  }
560414
public void addSystem(SubSystem system)
  {
    @SuppressWarnings("unchecked")
    Class<SubSystem> cl = (Class<SubSystem>) system.getClass();
    
    addSystem(cl, system);
  }
359459
public static Related with(CanonicalPath entityPath, String relationship) {
        return new Related(entityPath, relationship, EntityRole.SOURCE);
    }
55323
public void add(Collection<Application> applications)
    {
        for(Application application : applications)
            this.applications.put(application.getId(), application);
    }
1095229
public function addRelationship(Relationship $relationship)
    {
        foreach ($this->relationships as $rel) {
            if ($rel->getType() === $relationship->getType() &&
            $rel->getStartNode() === $relationship->getStartNode() &&
            $rel->getEndNode() === $relationship->getEndNode()) {
                throw new SchemaDefinitionException(sprintf('There is already a relationship declared with TYPE "%s" and STARTNODE "%s" and ENDNODE "%s"',
                    $relationship->getType(), $relationship->getStartNode(), $relationship->getEndNode()));
            }
        }

        return $this->relationships->add($relationship);
    }
1214077
void addSubsystem(final OperationTransformerRegistry registry, final String name, final ModelVersion version) {
        final OperationTransformerRegistry profile = registry.getChild(PathAddress.pathAddress(PROFILE));
        final OperationTransformerRegistry server = registry.getChild(PathAddress.pathAddress(HOST, SERVER));
        final PathAddress address = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, name));
        subsystem.mergeSubtree(profile, Collections.singletonMap(address, version));
        if(server != null) {
            subsystem.mergeSubtree(server, Collections.singletonMap(address, version));
        }
    }
1360075
public void addAllIfNotExist(Properties properties) {
    for (String key : properties.stringPropertyNames()) {
      if (!this.specProperties.containsKey(key) && !this.commonProperties.containsKey(key)) {
        this.specProperties.setProperty(key, properties.getProperty(key));
      }
    }
  }
184123
public int addAll(KTypeContainer<? extends KType> container) {
    ensureCapacity(container.size());
    return addAll((Iterable<? extends KTypeCursor<? extends KType>>) container);
  }
153652
function UMLDirectedRelationship() {
        type.DirectedRelationship.apply(this, arguments);

        /** @member {UMLStereotype} */
        this.stereotype = null;

        /** @member {string} */
        this.visibility = VK_PUBLIC;
        // mixin UMLElementMixin
        _.extend(UMLDirectedRelationship.prototype, UMLElementMixin);
    }
225212
public final void addSubEntries(final Collection<NavigationEntryInterface> psubEntries) {
    if (!CollectionUtils.isEmpty(psubEntries)) {
      subEntries.addAll(psubEntries);
      subEntries.forEach(subEntry -> subEntry.setParentEntry(this));
    }
  }
783077
public void mergeRelationInformation(TDRelation relation) {
        if (relation.hasTags()) {
            addTags(relation.getTags());
        }
        if (getName() == null && relation.getName() != null) {
            setName(relation.getName());
        }
        if (getRef() == null && relation.getRef() != null) {
            setRef(relation.getRef());
        }
    }
1229377
public void addRelationshipToProcessTopic(final SpecTopic topic, final RelationshipType type) {
        final ProcessRelationship relationship = new ProcessRelationship(this, topic, type);
        topicTargetRelationships.add(relationship);
        relationships.add(relationship);
    }
915991
@JsonSetter("enterpriseContextViews")
    void setEnterpriseContextViews(Collection<SystemLandscapeView> enterpriseContextViews) {
        if (enterpriseContextViews != null) {
            this.systemLandscapeViews = new HashSet<>(enterpriseContextViews);
        }
    }
301332
protected static void applyRelationships(final ContentSpec contentSpec, final Map<Integer, Node> nodes,
            final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes, final List<Process> processes,
            final DataProviderFactory providerFactory) {
        // Apply the user defined relationships stored in the database
        for (final CSNodeWrapper node : relationshipFromNodes) {
            boolean initialContentTopic = node.getNodeType() == CommonConstants.CS_NODE_INITIAL_CONTENT_TOPIC;
            boolean level = EntityUtilities.isNodeALevel(node);

            // In 1.3 or lower initial content relationships were stored on the topic, however in 1.4+ they are now on the initial
            // content level, so do the migration here
            final SpecNodeWithRelationships fromNode;
            if (initialContentTopic) {
                final CSNodeWrapper parentNode = node.getParent();
                final SpecNodeWithRelationships parent = (SpecNodeWithRelationships) nodes.get(parentNode.getId());
                if (parent instanceof InitialContent) {
                    fromNode = parent;
                } else {
                    final Level parentLevel = (Level) parent;
                    if (parentLevel.getFirstSpecNode() instanceof InitialContent) {
                        fromNode = (SpecNodeWithRelationships) parentLevel.getFirstSpecNode();
                    } else {
                        fromNode = new InitialContent(parent.getLineNumber(), CSConstants.LEVEL_INITIAL_CONTENT + ":");
                        if (parentLevel.getChildNodes().isEmpty()) {
                            parentLevel.appendChild(fromNode);
                        } else {
                            parentLevel.insertBefore(fromNode, parentLevel.getChildNodes().get(0));
                        }
                    }
                }
            } else {
                fromNode = (SpecNodeWithRelationships) nodes.get(node.getId());
            }

            // Check if we have any relationships to process
            if (node.getRelatedToNodes() == null || node.getRelatedToNodes().isEmpty()) continue;
            final List<CSRelatedNodeWrapper> relatedToNodes = node.getRelatedToNodes().getItems();

            // Sort the relationships into the correct order based on the sort variable
            Collections.sort(relatedToNodes, new CSRelatedNodeSorter());

            // Add the relationships to the topic
            for (final CSRelatedNodeWrapper relatedToNode : relatedToNodes) {
                final Node toNode = nodes.get(relatedToNode.getId());
                if (toNode == null) {
                    throw new IllegalStateException("The related node does not exist in the content specification");
                } else if (toNode instanceof Level) {
                    // Relationships to levels
                    final Level toLevel = (Level) toNode;

                    // Ensure that the level has a target id if not create one.
                    if (toLevel.getTargetId() == null) {
                        toLevel.setTargetId("T00" + relatedToNode.getId());
                    }

                    // Add the relationship
                    fromNode.addRelationshipToTarget(toLevel, RelationshipType.getRelationshipType(relatedToNode.getRelationshipType()),
                            initialContentTopic || level ? null : toLevel.getTitle());
                } else {
                    // Relationships to topics
                    final SpecTopic toSpecTopic = (SpecTopic) toNode;
                    final String title = toSpecTopic.getTitle();

                    // Add the relationship
                    if (relatedToNode.getRelationshipMode().equals(CommonConstants.CS_RELATIONSHIP_MODE_TARGET)) {
                        fromNode.addRelationshipToTarget(toSpecTopic,
                                RelationshipType.getRelationshipType(relatedToNode.getRelationshipType()),
                                initialContentTopic || level ? null : title);
                    } else {
                        fromNode.addRelationshipToTopic(toSpecTopic,
                                RelationshipType.getRelationshipType(relatedToNode.getRelationshipType()),
                                initialContentTopic || level ? null : title);
                    }
                }
            }
        }

        // Create the unique id map
        final Map<String, SpecTopic> uniqueIdSpecTopicMap = ContentSpecUtilities.getUniqueIdSpecTopicMap(contentSpec);

        // Apply the process relationships
        for (final Process process : processes) {
            process.processTopics(uniqueIdSpecTopicMap, targetTopics, providerFactory.getProvider(TopicProvider.class),
                    providerFactory.getProvider(ServerSettingsProvider.class));
        }
    }
778846
static void parseSubsystems(ModelNode node, List<Subsystem> subsystems) {
        List<Property> properties = node.get("subsystem").asPropertyList();
        for (Property property : properties) {
            Subsystem subsystem = new Subsystem(property.getName(), property.getValue());
            subsystems.add(subsystem);
        }
    }