spi: consolidate common member
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronSFCPortPairGroup.java
index 63b62bbafd66a060d8edabfb4306e72433c53c54..3be05c1c67f45cc66eb6d853e0afc7c4e715f835 100644 (file)
@@ -8,7 +8,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 +16,19 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public final class NeutronSFCPortPairGroup extends NeutronObject<NeutronSFCPortPairGroup>
-        implements Serializable, INeutronObject<NeutronSFCPortPairGroup> {
+public final class NeutronSFCPortPairGroup extends NeutronBaseAttributes<NeutronSFCPortPairGroup>
+        implements Serializable {
     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;
     }
@@ -60,18 +48,8 @@ public final class NeutronSFCPortPairGroup extends NeutronObject<NeutronSFCPortP
 
     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());
-            }
+        for (String s : fields) {
+            extractField(s, ans);
             if (s.equals("port_pairs")) {
                 ans.setPortPairs(this.getPortPairs());
             }