Merge "Checkstyle enforcer"
[controller.git] / opendaylight / forwardingrulesmanager / api / src / main / java / org / opendaylight / controller / forwardingrulesmanager / FlowEntry.java
index 2e174d25e29930e43431d72052c8060ddc5b9939..8a055329e1fcebc99c60a904b4dc547779010e56 100644 (file)
@@ -11,8 +11,6 @@ package org.opendaylight.controller.forwardingrulesmanager;
 import java.io.Serializable;
 import java.util.Date;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.opendaylight.controller.sal.core.ContainerFlow;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
@@ -53,7 +51,7 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Return the actual Flow contained in this entry
-     * 
+     *
      * @return the flow
      */
     public Flow getFlow() {
@@ -90,12 +88,47 @@ public class FlowEntry implements Cloneable, Serializable {
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((flow == null) ? 0 : flow.hashCode());
+        result = prime * result
+                + ((flowName == null) ? 0 : flowName.hashCode());
+        result = prime * result
+                + ((groupName == null) ? 0 : groupName.hashCode());
+        result = prime * result + ((node == null) ? 0 : node.hashCode());
+        return result;
     }
 
     @Override
     public boolean equals(Object obj) {
-        return EqualsBuilder.reflectionEquals(this, obj);
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        FlowEntry other = (FlowEntry) obj;
+        if (flow == null) {
+            if (other.flow != null)
+                return false;
+        } else if (!flow.equals(other.flow))
+            return false;
+        if (flowName == null) {
+            if (other.flowName != null)
+                return false;
+        } else if (!flowName.equals(other.flowName))
+            return false;
+        if (groupName == null) {
+            if (other.groupName != null)
+                return false;
+        } else if (!groupName.equals(other.groupName))
+            return false;
+        if (node == null) {
+            if (other.node != null)
+                return false;
+        } else if (!node.equals(other.node))
+            return false;
+        return true;
     }
 
     @Override
@@ -114,12 +147,12 @@ public class FlowEntry implements Cloneable, Serializable {
 
     /**
      * Merges the current Flow with the passed Container Flow
-     * 
+     *
      * Note: Container Flow merging is not an injective function. Be m1 and m2
      * two different matches, and be f() the flow merge function, such that y1 =
      * f(m1) and y2 = f(m2) are the two merged matches, we may have: y1 = y2
-     * 
-     * 
+     *
+     *
      * @param containerFlow
      * @return this merged FlowEntry
      */