checkstyle: JavadocStyleCheck
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronRouterInterface.java
1 /*
2  * Copyright (c) 2013, 2015 IBM Corporation 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
9 package org.opendaylight.neutron.spi;
10
11 import java.io.Serializable;
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;
17
18 @XmlRootElement
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronRouterInterface extends NeutronObject<NeutronRouterInterface>
21         implements Serializable, INeutronObject<NeutronRouterInterface> {
22     private static final long serialVersionUID = 1L;
23
24     // See OpenStack Network API v2.0 Reference for description of
25     // annotated attributes
26
27     @XmlElement(name = "subnet_id")
28     String subnetUUID;
29
30     @XmlElement(name = "port_id")
31     String portUUID;
32
33     public NeutronRouterInterface() {
34     }
35
36     public NeutronRouterInterface(String subnetUUID, String portUUID) {
37         this.subnetUUID = subnetUUID;
38         this.portUUID = portUUID;
39     }
40
41     public String getSubnetUUID() {
42         return subnetUUID;
43     }
44
45     public void setSubnetUUID(String subnetUUID) {
46         this.subnetUUID = subnetUUID;
47     }
48
49     public String getPortUUID() {
50         return portUUID;
51     }
52
53     public void setPortUUID(String portUUID) {
54         this.portUUID = portUUID;
55     }
56
57     @Override
58     public NeutronRouterInterface extractFields(List<String> fields) {
59         NeutronRouterInterface ans = new NeutronRouterInterface();
60         for (String s : fields) {
61             extractField(s, ans);
62             if (s.equals("subnet_id")) {
63                 ans.setSubnetUUID(this.getSubnetUUID());
64             }
65             if (s.equals("port_id")) {
66                 ans.setPortUUID(this.getPortUUID());
67             }
68         }
69         return ans;
70     }
71
72     @Override
73     public String toString() {
74         return "NeutronRouterInterface [" + "subnetUUID=" + subnetUUID + ", portUUID=" + portUUID + ", id=" + uuid
75                 + ", tenantID=" + tenantID + "]";
76     }
77 }