From 15738432c81b94056c425ed8c7db4f398912bd4a Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Mon, 12 Nov 2018 19:34:38 +0900 Subject: Fix sonar blocker issue in catalog-dao Override equals() method in GraphRelation.java Issue-ID: SDC-1895 Change-Id: Ib6538043f81173336c30d6a97545ef036431c79f Signed-off-by: Parshad Patel --- .../sdc/be/dao/graph/datatype/GraphRelation.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'catalog-dao/src/main/java') diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphRelation.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphRelation.java index 0c6b66f6d9..3249f37b31 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphRelation.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/graph/datatype/GraphRelation.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.dao.graph.datatype; import java.util.HashMap; import java.util.Map; +import org.apache.commons.lang3.builder.EqualsBuilder; public class GraphRelation extends GraphElement { @@ -105,4 +106,21 @@ public class GraphRelation extends GraphElement { result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + + if (obj == null) + return false; + + if (!(obj instanceof GraphRelation)) { + return false; + } + + GraphRelation other = (GraphRelation) obj; + + return new EqualsBuilder().append(from, other.from).append(properties, other.properties).append(to, other.to).append(type, other.type).isEquals(); + } } -- cgit 1.2.3-korg