/*
 * Copyright (C) 2013 Red Hat, Inc.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Authors : Madhu Venugopal, Brent Salisbury
 */
package org.opendaylight.ovsdb.openstack.netvirt;

import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.openstack.netvirt.api.Action;

public class SouthboundEvent extends AbstractEvent {
    public enum Type { NODE, ROW };
    private Type type;
    private Node node;
    private String tableName;
    private String uuid;
    private Row row;
    private Object context;
    public SouthboundEvent(Node node, Action action) {
        super(HandlerType.SOUTHBOUND, action);
        this.type = Type.NODE;
        this.node = node;
    }
    public SouthboundEvent(Node node, String tableName, String uuid, Row row, Action action) {
        super(HandlerType.SOUTHBOUND, action);
        this.type = Type.ROW;
        this.node = node;
        this.tableName = tableName;
        this.uuid = uuid;
        this.row = row;
    }
    public SouthboundEvent(Node node, String tableName, String uuid, Row row, Object context, Action action) {
        super(HandlerType.SOUTHBOUND, action);
        this.type = Type.ROW;
        this.node = node;
        this.tableName = tableName;
        this.uuid = uuid;
        this.row = row;
        this.context = context;
    }
    public Type getType() {
        return type;
    }
    public Node getNode() {
        return node;
    }
    public String getTableName() {
        return tableName;
    }
    public String getUuid() {
        return uuid;
    }
    public Row getRow() {
        return row;
    }
    public Object getContext() {
        return context;
    }
    @Override
    public String toString() {
        return "SouthboundEvent [type=" + type + ", action=" + super.getAction() + ", node=" + node + ", tableName=" + tableName
                + ", uuid=" + uuid + ", row=" + row + ", context=" + context.toString() + "]";
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + ((node == null) ? 0 : node.hashCode());
        result = prime * result + ((tableName == null) ? 0 : tableName.hashCode());
        result = prime * result + ((type == null) ? 0 : type.hashCode());
        result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        if (!super.equals(obj))
            return false;
        SouthboundEvent other = (SouthboundEvent) obj;
        if (node == null) {
            if (other.node != null)
                return false;
        } else if (!node.equals(other.node))
            return false;
        if (tableName == null) {
            if (other.tableName != null)
                return false;
        } else if (!tableName.equals(other.tableName))
            return false;
        if (type == null) {
            if (other.type != null)
                return false;
        } else if (!type.equals(other.type))
            return false;
        if (uuid == null) {
            if (other.uuid != null)
                return false;
        } else if (!uuid.equals(other.uuid))
            return false;
        return true;
    }
}

@@ -607,17 +607,16 @@
 E, ROW %7D
-;
 %0A    pri
@@ -2699,16 +2699,18 @@
  == obj)
+ %7B
 %0A       
@@ -2723,24 +2723,34 @@
 eturn true;%0A
+        %7D%0A
         if (
@@ -2757,24 +2757,26 @@
 obj == null)
+ %7B
 %0A           
@@ -2782,32 +2782,42 @@
   return false;%0A
+        %7D%0A
         if (getC
@@ -2841,16 +2841,18 @@
 Class())
+ %7B
 %0A       
@@ -2862,32 +2862,42 @@
   return false;%0A
+        %7D%0A
         if (!sup
@@ -2911,16 +2911,18 @@
 ls(obj))
+ %7B
 %0A       
@@ -2932,32 +2932,42 @@
   return false;%0A
+        %7D%0A
         Southbou
@@ -3060,32 +3060,34 @@
 er.node != null)
+ %7B
 %0A               
@@ -3093,32 +3093,46 @@
   return false;%0A
+            %7D%0A
         %7D else i
@@ -3159,16 +3159,18 @@
 r.node))
+ %7B
 %0A       
@@ -3180,32 +3180,42 @@
   return false;%0A
+        %7D%0A
         if (tabl
@@ -3263,32 +3263,34 @@
 bleName != null)
+ %7B
 %0A               
@@ -3296,32 +3296,46 @@
   return false;%0A
+            %7D%0A
         %7D else i
@@ -3372,16 +3372,18 @@
 leName))
+ %7B
 %0A       
@@ -3393,32 +3393,42 @@
   return false;%0A
+        %7D%0A
         if (type
@@ -3466,32 +3466,34 @@
 er.type != null)
+ %7B
 %0A               
@@ -3499,32 +3499,46 @@
   return false;%0A
+            %7D%0A
         %7D else i
@@ -3565,16 +3565,18 @@
 r.type))
+ %7B
 %0A       
@@ -3586,32 +3586,42 @@
   return false;%0A
+        %7D%0A
         if (uuid
@@ -3667,16 +3667,18 @@
 != null)
+ %7B
 %0A       
@@ -3692,32 +3692,46 @@
   return false;%0A
+            %7D%0A
         %7D else i
@@ -3758,16 +3758,18 @@
 r.uuid))
+ %7B
 %0A       
@@ -3779,32 +3779,42 @@
   return false;%0A
+        %7D%0A
         return t

Fix Major Sonar Issues: SouthboundEvent.java.