Fix sonar violations
[aai/gizmo.git] / src / main / java / org / onap / crud / event / GraphEvent.java
index 958c227..b189373 100644 (file)
@@ -172,11 +172,28 @@ public class GraphEvent {
   public String toString() {
     return toJson();
   }
-  
+
+  @Override
+  public boolean equals(Object o){
+    if(o == this){
+      return true;
+    }
+
+    if( !(o instanceof GraphEvent)){
+      return false;
+    }
+
+    GraphEvent graphEvent = (GraphEvent) o;
+    return this.dbTransactionId.equals(
+        graphEvent.getDbTransactionId())
+        && this.timestamp == graphEvent.getTimestamp()
+        && this.operation.equals(graphEvent.getOperation()
+    );
+  }
+
   @Override
   public int hashCode() {
-    return Objects.hash(this.dbTransactionId, this.timestamp, this.edge, this.vertex, this.operation,
-              this.result);
+    return Objects.hash(this.dbTransactionId, this.timestamp, this.operation);
   }
 
   public String getObjectKey() {