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

com.github.aschet.spdx.licensecompat.graph.io.LicenseEdgeProvider Maven / Gradle / Ivy

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