ecf4c5459f1d31b566a5043397a7b413216611f9
[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     @Override
41     protected boolean extractField(String field, NeutronSFCPortPairGroup ans) {
42         switch (field) {
43             case "port_pairs":
44                 ans.setPortPairs(this.getPortPairs());
45                 break;
46             default:
47                 return super.extractField(field, ans);
48         }
49         return true;
50     }
51
52     @Override
53     public String toString() {
54         return "NeutronSFCPortPairGroup[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\'' + ", portPairs="
55                 + portPairs + ']';
56     }
57 }