NEUTRON-162: vlan_transparent attribute is missing in network_attributes
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronRouter.java
index a6172415fdd82cbf0fcf81aea1567071d23b101d..cf49da79e51beef93b165f93bd207918114d9188 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.neutron.spi;
 
-import java.io.Serializable;
 import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -17,14 +16,13 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter>
-        implements Serializable {
+public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter> {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
     @XmlElement(name = "external_gateway_info", nillable = true)
-    NeutronRouter_NetworkReference externalGatewayInfo;
+    NeutronRouterNetworkReference externalGatewayInfo;
 
     @XmlElement(name = "distributed")
     Boolean distributed;
@@ -38,18 +36,11 @@ public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter>
     public NeutronRouter() {
     }
 
-    public boolean isAdminStateUp() {
-        if (adminStateUp == null) {
-            return true;
-        }
-        return adminStateUp;
-    }
-
-    public NeutronRouter_NetworkReference getExternalGatewayInfo() {
+    public NeutronRouterNetworkReference getExternalGatewayInfo() {
         return externalGatewayInfo;
     }
 
-    public void setExternalGatewayInfo(NeutronRouter_NetworkReference externalGatewayInfo) {
+    public void setExternalGatewayInfo(NeutronRouterNetworkReference externalGatewayInfo) {
         this.externalGatewayInfo = externalGatewayInfo;
     }
 
@@ -77,38 +68,25 @@ public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter>
         this.routes = routes;
     }
 
-    /**
-     * This method copies selected fields from the object and returns them
-     * as a new object, suitable for marshaling.
-     *
-     * @param fields
-     *            List of attributes to be extracted
-     * @return an OpenStackRouters object with only the selected fields
-     * populated
-     */
-    public NeutronRouter extractFields(List<String> fields) {
-        NeutronRouter ans = new NeutronRouter();
-        for (String s : fields) {
-            extractField(s, ans);
-            if (s.equals("external_gateway_info")) {
+    @Override
+    protected boolean extractField(String field, NeutronRouter ans) {
+        switch (field) {
+            case "external_gateway_info":
                 ans.setExternalGatewayInfo(this.getExternalGatewayInfo());
-            }
-            if (s.equals("distributed")) {
+                break;
+            case "distributed":
                 ans.setDistributed(this.getDistributed());
-            }
-            if (s.equals("gw_port_id")) {
+                break;
+            case "gw_port_id":
                 ans.setGatewayPortId(this.getGatewayPortId());
-            }
-            if (s.equals("routes")) {
+                break;
+            case "routes":
                 ans.setRoutes(this.getRoutes());
-            }
+                break;
+            default:
+                return super.extractField(field, ans);
         }
-        return ans;
-    }
-
-    @Override
-    public void initDefaults() {
-        adminStateUp = true;
+        return true;
     }
 
     @Override