Merge "toaster-it: add missing version for maven-paxexam-plugin"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / TimeStamp.java
index cfdceac82290de788caf94d44023f34090c6c402..b38ec8582b17db2d765a35c9df4d3b888ed96228 100644 (file)
@@ -9,12 +9,8 @@
 
 package org.opendaylight.controller.sal.core;
 
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-
-import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
 
 /**
  * @file   TimeStamp.java
@@ -29,9 +25,9 @@ import javax.xml.bind.annotation.XmlElement;
 @XmlRootElement
 public class TimeStamp extends Property {
     private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name = "value")
     private long timestamp;
-    @XmlElement
+    @XmlElement(name = "name")
     private String timestampName;
 
     public static final String TimeStampPropName = "timeStamp";
@@ -61,6 +57,7 @@ public class TimeStamp extends Property {
         this.timestampName = null;
     }
 
+    @Override
     public TimeStamp clone() {
         return new TimeStamp(this.timestamp, this.timestampName);
     }
@@ -75,16 +72,35 @@ public class TimeStamp extends Property {
 
     @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) {
-        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
     public String toString() {
-        return "TimeStamp[" + ReflectionToStringBuilder.toString(this) + "]";
+        return "TimeStamp[" + timestampName + ": " + timestamp +"]";
     }
 }