3be05c1c67f45cc66eb6d853e0afc7c4e715f835
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronSFCPortPairGroup.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.neutron.spi;
9
10 import java.io.Serializable;
11 import java.util.List;
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronSFCPortPairGroup extends NeutronBaseAttributes<NeutronSFCPortPairGroup>
20         implements Serializable {
21     private static final long serialVersionUID = 1L;
22
23     // See OpenStack Networking SFC (networking-sfc) Port Pair Group API v1.0
24     // Reference for description of annotated attributes
25
26     @XmlElement(name = "port_pairs")
27     List<String> portPairs;
28
29     public NeutronSFCPortPairGroup() {
30     }
31
32     public List<String> getPortPairs() {
33         return portPairs;
34     }
35
36     public void setPortPairs(List<String> portPairs) {
37         this.portPairs = portPairs;
38     }
39
40     /**
41      * This method copies selected fields from the object and returns them
42      * as a new object, suitable for marshaling.
43      *
44      * @param fields List of attributes to be extracted
45      * @return an OpenStack Neutron SFC Port Pair Group object with only the selected fields
46      * populated
47      */
48
49     public NeutronSFCPortPairGroup extractFields(List<String> fields) {
50         NeutronSFCPortPairGroup ans = new NeutronSFCPortPairGroup();
51         for (String s : fields) {
52             extractField(s, ans);
53             if (s.equals("port_pairs")) {
54                 ans.setPortPairs(this.getPortPairs());
55             }
56         }
57         return ans;
58     }
59
60     @Override
61     public String toString() {
62         return "NeutronSFCPortPairGroup[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\'' + ", portPairs="
63                 + portPairs + ']';
64     }
65 }