Fixing warnings in the sal sub-project.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / TimeStamp.java
index a15b3fa9cd10166b3179e163c80b5de7f50170ba..67f2b25bd272a67027a91174163d1b372dc41bb0 100644 (file)
@@ -9,6 +9,10 @@
 
 package org.opendaylight.controller.sal.core;
 
+import java.util.Date;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -23,11 +27,12 @@ import javax.xml.bind.annotation.XmlRootElement;
  * to qualify what are we talking about
  */
 @XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
 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";
@@ -57,6 +62,7 @@ public class TimeStamp extends Property {
         this.timestampName = null;
     }
 
+    @Override
     public TimeStamp clone() {
         return new TimeStamp(this.timestamp, this.timestampName);
     }
@@ -102,4 +108,9 @@ public class TimeStamp extends Property {
     public String toString() {
         return "TimeStamp[" + timestampName + ": " + timestamp +"]";
     }
+
+    @Override
+    public String getStringValue() {
+        return timestampName + ": " + new Date(timestamp);
+    }
 }