added static newInstance method

This commit is contained in:
Miriam Baglioni 2020-07-30 16:49:09 +02:00
parent e163b1df79
commit 3a0f5f1e1b
1 changed files with 9 additions and 0 deletions

View File

@ -49,4 +49,13 @@ public class Relation implements Serializable {
return Objects.hash(source.getId(), target.getId(), reltype.getType() + ":" + reltype.getName()); return Objects.hash(source.getId(), target.getId(), reltype.getType() + ":" + reltype.getName());
} }
public static Relation newInstance(Node source, Node target, RelType reltype, Provenance provenance) {
Relation relation = new Relation();
relation.source = source;
relation.target = target;
relation.reltype = reltype;
relation.provenance = provenance;
return relation;
}
} }