2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.neutron.spi;
10 import java.io.Serializable;
11 import java.util.Iterator;
12 import java.util.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronSFCPortPairGroup extends NeutronObject<NeutronSFCPortPairGroup>
21 implements Serializable, INeutronObject<NeutronSFCPortPairGroup> {
22 private static final long serialVersionUID = 1L;
24 // See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0
25 // Reference for description of annotated attributes
27 @XmlElement(name = "name")
30 @XmlElement(name = "port_pairs")
31 List<String> portPairs;
33 public NeutronSFCPortPairGroup() {
36 public String getName() {
40 public void setName(String name) {
44 public List<String> getPortPairs() {
48 public void setPortPairs(List<String> portPairs) {
49 this.portPairs = portPairs;
53 * This method copies selected fields from the object and returns them
54 * as a new object, suitable for marshaling.
56 * @param fields List of attributes to be extracted
57 * @return an OpenStack Neutron SFC Port Pair Group object with only the selected fields
61 public NeutronSFCPortPairGroup extractFields(List<String> fields) {
62 NeutronSFCPortPairGroup ans = new NeutronSFCPortPairGroup();
63 Iterator<String> i = fields.iterator();
67 ans.setID(this.getID());
69 if (s.equals("tenant_id")) {
70 ans.setTenantID(this.getTenantID());
72 if (s.equals("name")) {
73 ans.setName(this.getName());
75 if (s.equals("port_pairs")) {
76 ans.setPortPairs(this.getPortPairs());
83 public String toString() {
84 return "NeutronSFCPortPairGroup[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\'' + ", portPairs="