From f3dcca0dd05d3f2fd0796fe47dd98a163da62058 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Wed, 27 May 2020 17:23:34 +0200 Subject: [PATCH] added equals for programme --- .../eu/dnetlib/dhp/schema/oaf/Programme.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java index 69223ab01..c5259d07e 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Programme.java @@ -1,7 +1,10 @@ package eu.dnetlib.dhp.schema.oaf; -public class Programme { +import java.io.Serializable; +import java.util.Objects; + +public class Programme implements Serializable { private String code; private String description; @@ -20,4 +23,17 @@ public class Programme { public void setDescription(String description) { this.description = description; } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + Programme programme = (Programme) o; + return Objects.equals(code, programme.code); + } + + }