Bump upstreams for Silicon
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronSFCPortPairGroup.java
index cbdce07aa03014d750b51d9283c18d1b3681961c..2d70305a7c0c18ea21c0190a58d80e268d372c07 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.neutron.spi;
 
-import java.io.Serializable;
-import java.util.Iterator;
 import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -17,30 +15,18 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSFCPortPairGroup extends NeutronObject implements Serializable, INeutronObject {
+public final class NeutronSFCPortPairGroup extends NeutronBaseAttributes<NeutronSFCPortPairGroup> {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0
     // Reference for description of annotated attributes
 
-    @XmlElement(name = "name")
-    String name;
-
     @XmlElement(name = "port_pairs")
     List<String> portPairs;
 
     public NeutronSFCPortPairGroup() {
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
     public List<String> getPortPairs() {
         return portPairs;
     }
@@ -49,42 +35,21 @@ public class NeutronSFCPortPairGroup extends NeutronObject implements Serializab
         this.portPairs = portPairs;
     }
 
-    /**
-     * 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 OpenStack Neutron SFC Port Pair Group object with only the selected fields
-     * populated
-     */
-
-    public NeutronSFCPortPairGroup extractFields(List<String> fields) {
-        NeutronSFCPortPairGroup ans = new NeutronSFCPortPairGroup();
-        Iterator<String> i = fields.iterator();
-        while (i.hasNext()) {
-            String s = i.next();
-            if (s.equals("id")) {
-                ans.setID(this.getID());
-            }
-            if (s.equals("tenant_id")) {
-                ans.setTenantID(this.getTenantID());
-            }
-            if (s.equals("name")) {
-                ans.setName(this.getName());
-            }
-            if (s.equals("port_pairs")) {
+    @Override
+    protected boolean extractField(String field, NeutronSFCPortPairGroup ans) {
+        switch (field) {
+            case "port_pairs":
                 ans.setPortPairs(this.getPortPairs());
-            }
+                break;
+            default:
+                return super.extractField(field, ans);
         }
-        return ans;
+        return true;
     }
 
     @Override
     public String toString() {
-        return "NeutronSFCPortPairGroup[" +
-                "tenantID='" + tenantID + '\'' +
-                ", name='" + name + '\'' +
-                ", portPairs=" + portPairs +
-                ']';
+        return "NeutronSFCPortPairGroup[" + "tenantID='" + getTenantID() + '\'' + ", name='" + name + '\''
+                + ", portPairs=" + portPairs + ']';
     }
 }