Add support for metadata to the Match/Action classes
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / core / Config.java
index ef6efc58211577fb9799509c1d998949a44364dc..64562fa6ed9571098edad14c021cafbdd9496f2c 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.controller.sal.core;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -18,6 +20,7 @@ import javax.xml.bind.annotation.XmlRootElement;
  */
 @XmlRootElement
 @SuppressWarnings("serial")
+@XmlAccessorType(XmlAccessType.NONE)
 public class Config extends Property {
     @XmlElement(name="value")
     private short configValue;
@@ -75,4 +78,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);
+        }
+    }
 }