Five more Equals/HashCode/StringBuilder replacements
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / action / PushVlan.java
index d50851ae49705df37bf61c5f143c3cdc7d87051d..f3b862fe7e2d2e16e5a5e07da4afa992d0478a6a 100644 (file)
@@ -14,8 +14,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.opendaylight.controller.sal.utils.EtherTypes;
 
 /**
@@ -147,13 +145,34 @@ public class PushVlan extends Action {
     }
 
     @Override
-    public boolean equals(Object other) {
-        return EqualsBuilder.reflectionEquals(this, other);
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        PushVlan other = (PushVlan) obj;
+        if (cfi != other.cfi)
+            return false;
+        if (pcp != other.pcp)
+            return false;
+        if (tag != other.tag)
+            return false;
+        if (vlanId != other.vlanId)
+            return false;
+        return true;
     }
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + cfi;
+        result = prime * result + pcp;
+        result = prime * result + tag;
+        result = prime * result + vlanId;
+        return result;
     }
 
     @Override