From 3a0f5f1e1b22a9665b4e517357f2939fbac3c24c Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 30 Jul 2020 16:49:09 +0200 Subject: [PATCH] added static newInstance method --- .../eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java index 664910f04..4b1a88ddc 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java @@ -49,4 +49,13 @@ public class Relation implements Serializable { 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; + } }