From 5f4de9a96276bc7ff0116eb6087950a5a875583b Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 30 Oct 2020 14:11:40 +0100 Subject: [PATCH] formatting --- .../graph/dump/graph/DumpGraphEntities.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java index 3a86cebeb..76e9ed87f 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/graph/DumpGraphEntities.java @@ -8,7 +8,6 @@ import java.io.StringReader; import java.util.*; import java.util.stream.Collectors; -import eu.dnetlib.dhp.schema.oaf.H2020Programme; import org.apache.spark.SparkConf; import org.apache.spark.api.java.function.MapFunction; import org.apache.spark.sql.Encoders; @@ -27,6 +26,7 @@ import eu.dnetlib.dhp.schema.dump.oaf.graph.*; import eu.dnetlib.dhp.schema.dump.oaf.graph.Funder; import eu.dnetlib.dhp.schema.dump.oaf.graph.Project; import eu.dnetlib.dhp.schema.oaf.Field; +import eu.dnetlib.dhp.schema.oaf.H2020Programme; import eu.dnetlib.dhp.schema.oaf.Journal; import eu.dnetlib.dhp.schema.oaf.OafEntity; @@ -379,14 +379,19 @@ public class DumpGraphEntities implements Serializable { } } - project.setH2020programme( - Optional.ofNullable(p.getH2020classification()) - .map(classification -> classification - .stream() - .map(c -> Programme.newInstance(c.getH2020Programme().getCode(), c.getH2020Programme().getDescription())).collect(Collectors.toList())) - .orElse(new ArrayList<>())); - - + project + .setH2020programme( + Optional + .ofNullable(p.getH2020classification()) + .map( + classification -> classification + .stream() + .map( + c -> Programme + .newInstance( + c.getH2020Programme().getCode(), c.getH2020Programme().getDescription())) + .collect(Collectors.toList())) + .orElse(new ArrayList<>())); Optional>> ofundTree = Optional .ofNullable(p.getFundingtree());