Seven more Equals/HashCode/StringBuilder replacements
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Bandwidth.java
index 32f661ca5ff29a7a14d284068692d45d83638e46..fa5cc10827d5847140dd21ec72b24138b23b901f 100644 (file)
@@ -12,9 +12,6 @@ package org.opendaylight.controller.sal.core;
 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;
-
 /**
  * @file   BandWidth.java
  *
@@ -84,12 +81,25 @@ public class Bandwidth extends Property {
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result
+                + (int) (bandwidthValue ^ (bandwidthValue >>> 32));
+        return result;
     }
 
     @Override
     public boolean equals(Object obj) {
-        return EqualsBuilder.reflectionEquals(this, obj);
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        Bandwidth other = (Bandwidth) obj;
+        if (bandwidthValue != other.bandwidthValue)
+            return false;
+        return true;
     }
 
     @Override