checkstyle: enable JavadocTagContinuationIndentation
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronFloatingIP.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 NeutronFloatingIP
21         extends NeutronObject<NeutronFloatingIP> implements Serializable, INeutronObject<NeutronFloatingIP> {
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 = "floating_network_id")
28     String floatingNetworkUUID;
29
30     @XmlElement(name = "port_id")
31     String portUUID;
32
33     @XmlElement(name = "fixed_ip_address")
34     String fixedIPAddress;
35
36     @XmlElement(name = "floating_ip_address")
37     String floatingIPAddress;
38
39     @XmlElement(name = "router_id")
40     String routerUUID;
41
42     @XmlElement(name = "status")
43     String status;
44
45     public NeutronFloatingIP() {
46     }
47
48     public String getFloatingNetworkUUID() {
49         return floatingNetworkUUID;
50     }
51
52     public void setFloatingNetworkUUID(String floatingNetworkUUID) {
53         this.floatingNetworkUUID = floatingNetworkUUID;
54     }
55
56     public String getPortUUID() {
57         return portUUID;
58     }
59
60     public String getRouterUUID() {
61         return routerUUID;
62     }
63
64     public void setPortUUID(String portUUID) {
65         this.portUUID = portUUID;
66     }
67
68     public String getFixedIPAddress() {
69         return fixedIPAddress;
70     }
71
72     public void setFixedIPAddress(String fixedIPAddress) {
73         this.fixedIPAddress = fixedIPAddress;
74     }
75
76     public String getFloatingIPAddress() {
77         return floatingIPAddress;
78     }
79
80     public void setFloatingIPAddress(String floatingIPAddress) {
81         this.floatingIPAddress = floatingIPAddress;
82     }
83
84     public void setRouterUUID(String routerUUID) {
85         this.routerUUID = routerUUID;
86     }
87
88     public String getStatus() {
89         return status;
90     }
91
92     public void setStatus(String status) {
93         this.status = status;
94     }
95
96     /**
97      * This method copies selected fields from the object and returns them
98      * as a new object, suitable for marshaling.
99      *
100      * @param fields
101      *            List of attributes to be extracted
102      * @return an OpenStackFloatingIPs object with only the selected fields
103      *             populated
104      */
105
106     public NeutronFloatingIP extractFields(List<String> fields) {
107         NeutronFloatingIP ans = new NeutronFloatingIP();
108         for (String s : fields) {
109             extractField(s, ans);
110             if (s.equals("floating_network_id")) {
111                 ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID());
112             }
113             if (s.equals("port_id")) {
114                 ans.setPortUUID(this.getPortUUID());
115             }
116             if (s.equals("fixed_ip_address")) {
117                 ans.setFixedIPAddress(this.getFixedIPAddress());
118             }
119             if (s.equals("floating_ip_address")) {
120                 ans.setFloatingIPAddress(this.getFloatingIPAddress());
121             }
122             if (s.equals("router_id")) {
123                 ans.setRouterUUID(this.getRouterUUID());
124             }
125             if (s.equals("status")) {
126                 ans.setStatus(this.getStatus());
127             }
128         }
129         return ans;
130     }
131
132     @Override
133     public String toString() {
134         return "NeutronFloatingIP{" + "fipUUID='" + uuid + '\'' + ", fipFloatingNetworkId='" + floatingNetworkUUID
135                 + '\'' + ", fipPortUUID='" + portUUID + '\'' + ", fipFixedIPAddress='" + fixedIPAddress + '\''
136                 + ", fipFloatingIPAddress=" + floatingIPAddress + ", fipTenantId='" + tenantID + '\''
137                 + ", fipRouterId='" + routerUUID + '\'' + ", fipStatus='" + status + '\'' + '}';
138     }
139 }