com.synopsys.integration.bdio.graph.BasicDependencyGraph Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of integration-bdio Show documentation
Show all versions of integration-bdio Show documentation
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.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());
}
}