using Objects.equals to check Field<T> equivalence

This commit is contained in:
Claudio Atzori 2020-05-25 10:14:15 +02:00
parent 0ab0206b4d
commit 4b34872b44
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
package eu.dnetlib.dhp.schema.oaf; package eu.dnetlib.dhp.schema.oaf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
public class Field<T> implements Serializable { public class Field<T> implements Serializable {
@ -39,6 +40,6 @@ public class Field<T> implements Serializable {
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())
return false; return false;
Field<T> other = (Field<T>) obj; Field<T> other = (Field<T>) obj;
return getValue().equals(other.getValue()); return Objects.equals(getValue(), other.getValue());
} }
} }