Simple changes to eliminate pmd warnings
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Config.java
index bae984eaec00f4f9524e4e0db719c8e2ec74e4e3..651c2f44e12ac8f3a93612b6dda5c3e8ca820e1c 100644 (file)
@@ -19,7 +19,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @SuppressWarnings("serial")
 public class Config extends Property {
-    @XmlElement
+    @XmlElement(name="value")
     private short configValue;
 
     public static final short ADMIN_DOWN = 0;
@@ -40,6 +40,7 @@ public class Config extends Property {
         this.configValue = config;
     }
 
+    @Override
     public Config clone() {
         return new Config(this.configValue);
     }
@@ -74,4 +75,17 @@ public class Config extends Property {
     public String toString() {
         return "Config["+ configValue +"]";
     }
+
+    @Override
+    public String getStringValue() {
+        if (configValue == 0) {
+            return "ADMIN_DOWN";
+        } else if (configValue == 1) {
+            return "ADMIN_UP";
+        } else if (configValue == 0x7fff) {
+            return "ADMIN_UNDEF";
+        } else {
+            return String.valueOf(configValue);
+        }
+    }
 }