From 7d9fd7502038dd028958f6536d4b2a49c530776f Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Fri, 17 Apr 2020 17:13:48 +0200 Subject: [PATCH] add method addPid --- .../eu/dnetlib/dhp/schema/oaf/Author.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java index 93ab60b05..edce29221 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Author.java @@ -1,8 +1,8 @@ package eu.dnetlib.dhp.schema.oaf; import java.io.Serializable; -import java.util.List; -import java.util.Objects; +import java.util.*; +import java.util.stream.Collectors; public class Author implements Serializable { @@ -83,4 +83,20 @@ public class Author implements Serializable { public int hashCode() { return Objects.hash(fullname, name, surname, rank, pid, affiliation); } + + public void addPid(StructuredProperty pid) { + + if (pid == null) + return; + + if(this.pid == null){ + this.pid = Arrays.asList(pid); + }else{ + this.pid.add(pid); + } + + + } + + }