Five more Equals/HashCode/StringBuilder replacements
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / TimeStamp.java
index 6b2467ee5daa6f496787fcdfd3ac83e21df098ca..a15b3fa9cd10166b3179e163c80b5de7f50170ba 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 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   TimeStamp.java
  *
 /**
  * @file   TimeStamp.java
  *
@@ -74,12 +71,31 @@ public class TimeStamp extends Property {
 
     @Override
     public int hashCode() {
 
     @Override
     public int hashCode() {
-        return HashCodeBuilder.reflectionHashCode(this);
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + (int) (timestamp ^ (timestamp >>> 32));
+        result = prime * result
+                + ((timestampName == null) ? 0 : timestampName.hashCode());
+        return result;
     }
 
     @Override
     public boolean equals(Object obj) {
     }
 
     @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;
+        TimeStamp other = (TimeStamp) obj;
+        if (timestamp != other.timestamp)
+            return false;
+        if (timestampName == null) {
+            if (other.timestampName != null)
+                return false;
+        } else if (!timestampName.equals(other.timestampName))
+            return false;
+        return true;
     }
 
     @Override
     }
 
     @Override