com.metaeffekt.artifact.analysis.bom.spdx.relationship.RelationshipGraphEdge Maven / Gradle / Ivy
The newest version!
package com.metaeffekt.artifact.analysis.bom.spdx.relationship;
import lombok.Getter;
import lombok.Setter;
import org.spdx.library.model.enumerations.RelationshipType;
import java.util.List;
/**
* This class serves as an edge of the RelationshipGraph class and tracks the relationship
* of two nodes.
*/
@Getter
@Setter
public class RelationshipGraphEdge {
private RelationshipGraphNode fromNode;
private List toNodes;
private RelationshipType relationshipType;
public RelationshipGraphEdge(RelationshipGraphNode fromNode,
List toNode, RelationshipType relationshipType) {
this.fromNode = fromNode;
this.toNodes = toNode;
this.relationshipType = relationshipType;
}
public void addToNode(RelationshipGraphNode toNode) {
this.toNodes.add(toNode);
}
@Override
public String toString() {
return "Relationship: " + fromNode.getId() + " - " + relationshipType.toString() + " - " + toNodes.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy