All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.synopsys.integration.bdio.graph.ProjectDependencyGraph Maven / Gradle / Ivy

Go to download

A library to allow for easy and clear creation of Black Duck I/O (bdio) documents.

The newest version!
/*
 * integration-bdio
 *
 * Copyright (c) 2024 Synopsys, Inc.
 *
 * Use subject to the terms and conditions of the Synopsys End User Software License and Maintenance Agreement. All rights reserved worldwide.
 */
package com.synopsys.integration.bdio.graph;

import java.util.Set;

import org.apache.commons.collections4.SetUtils;

import com.synopsys.integration.bdio.model.Forge;
import com.synopsys.integration.bdio.model.dependency.Dependency;
import com.synopsys.integration.bdio.model.dependency.ProjectDependency;
import com.synopsys.integration.bdio.model.externalid.ExternalId;

public class ProjectDependencyGraph extends DependencyGraph {
    private final ProjectDependency projectDependency;

    public ProjectDependencyGraph(Dependency projectDependency) {
        this.projectDependency = new ProjectDependency(projectDependency);
    }

    public ProjectDependencyGraph(ProjectDependency projectDependency) {
        this.projectDependency = projectDependency;
    }

    public ProjectDependencyGraph(Forge forge, String relativePath) {
        this(new ProjectDependency(ExternalId.FACTORY.createPathExternalId(forge, relativePath)));
    }

    public ProjectDependency getProjectDependency() {
        return projectDependency;
    }

    @Override
    public void addDirectDependency(Dependency child) {
        addParentWithChild(projectDependency, child);
    }

    @Override
    public Set getDirectDependencies() {
        return getChildrenForParent(projectDependency);
    }

    @Override
    public Set getRootDependencies() {
        return SetUtils.hashSet(projectDependency);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy