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

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

Go to download

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

There is a newer version: 26.0.13
Show newest version
/*
 * integration-bdio
 *
 * Copyright (c) 2022 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.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

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

public class BasicDependencyGraph extends DependencyGraph {
    private final Set directDependencies = new HashSet<>();

    @Override
    public Set getDirectDependencies() {
        return directDependencies.stream()
            .map(dependencies::get)
            .collect(Collectors.toSet());
    }

    @Override
    public Set getRootDependencies() {
        return getDirectDependencies();
    }

    @Override
    public void addDirectDependency(Dependency child) {
        ensureDependencyExists(child);
        directDependencies.add(child.getExternalId());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy