
com.github.aschet.spdx.licensecompat.graph.io.LicenseEdgeProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spdx-license-compat Show documentation
Show all versions of spdx-license-compat Show documentation
A license compatibility graph implementation for SPDX license identifiers.
The newest version!
/**
* Copyright 2017 Thomas Ascher
* SPDX-License-Identifier: LGPL-3.0+
*/
package com.github.aschet.spdx.licensecompat.graph.io;
import java.util.Map;
import org.jgrapht.ext.EdgeProvider;
import com.github.aschet.spdx.licensecompat.graph.LicenseEdge;
import com.github.aschet.spdx.licensecompat.graph.LicenseEdgeType;
import com.github.aschet.spdx.licensecompat.graph.LicenseVertex;
/**
* Part of {@link LicenseCompatGraphImporter} to create the correct edge types.
*
* @author Thomas Ascher
*/
final class LicenseEdgeProvider implements EdgeProvider {
@Override
public LicenseEdge buildEdge(final LicenseVertex from, final LicenseVertex to, final String label,
final Map attributes) {
final LicenseEdge edge = new LicenseEdge();
if (label.equals(LicenseEdgeType.NON_TRANSITIVE.toString())) {
edge.setType(LicenseEdgeType.NON_TRANSITIVE);
}
return edge;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy