Simple changes to eliminate pmd warnings
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / TimeStamp.java
index a15b3fa9cd10166b3179e163c80b5de7f50170ba..c0c8da7ae2fa569c20975f91f1ac7f81bd409052 100644 (file)
@@ -9,6 +9,8 @@
 
 package org.opendaylight.controller.sal.core;
 
+import java.util.Date;
+
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -25,9 +27,9 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 public class TimeStamp extends Property {
     private static final long serialVersionUID = 1L;
-    @XmlElement
+    @XmlElement(name = "value")
     private long timestamp;
-    @XmlElement
+    @XmlElement(name = "timestampName")
     private String timestampName;
 
     public static final String TimeStampPropName = "timeStamp";
@@ -57,6 +59,7 @@ public class TimeStamp extends Property {
         this.timestampName = null;
     }
 
+    @Override
     public TimeStamp clone() {
         return new TimeStamp(this.timestamp, this.timestampName);
     }
@@ -102,4 +105,9 @@ public class TimeStamp extends Property {
     public String toString() {
         return "TimeStamp[" + timestampName + ": " + timestamp +"]";
     }
+
+    @Override
+    public String getStringValue() {
+        return timestampName + ": " + new Date(timestamp);
+    }
 }