*/
package org.onap.crud.event;
+import java.util.Objects;
+import javax.ws.rs.core.Response.Status;
+import org.onap.crud.exception.CrudException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
-import org.onap.crud.exception.CrudException;
-
-import javax.ws.rs.core.Response.Status;
-
public class GraphEvent {
public enum GraphEventOperation {
@Override
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.operation);
+ }
+
public String getObjectKey() {
if (this.getVertex() != null) {
return this.getVertex().getId();