Fix FindBugs violations
[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 javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 @XmlRootElement
17 @XmlAccessorType(XmlAccessType.NONE)
18 public final class NeutronFloatingIp extends NeutronObject<NeutronFloatingIp> {
19     private static final long serialVersionUID = 1L;
20
21     // See OpenStack Network API v2.0 Reference for description of
22     // annotated attributes
23
24     @XmlElement(name = "floating_network_id")
25     String floatingNetworkUUID;
26
27     @XmlElement(name = "port_id")
28     String portUUID;
29
30     @XmlElement(name = "fixed_ip_address")
31     String fixedIpAddress;
32
33     @XmlElement(name = "floating_ip_address")
34     String floatingIpAddress;
35
36     @XmlElement(name = "router_id")
37     String routerUUID;
38
39     @XmlElement(name = "status")
40     String status;
41
42     public NeutronFloatingIp() {
43     }
44
45     public String getFloatingNetworkUUID() {
46         return floatingNetworkUUID;
47     }
48
49     public void setFloatingNetworkUUID(String floatingNetworkUUID) {
50         this.floatingNetworkUUID = floatingNetworkUUID;
51     }
52
53     public String getPortUUID() {
54         return portUUID;
55     }
56
57     public String getRouterUUID() {
58         return routerUUID;
59     }
60
61     public void setPortUUID(String portUUID) {
62         this.portUUID = portUUID;
63     }
64
65     public String getFixedIpAddress() {
66         return fixedIpAddress;
67     }
68
69     public void setFixedIpAddress(String fixedIpAddress) {
70         this.fixedIpAddress = fixedIpAddress;
71     }
72
73     public String getFloatingIpAddress() {
74         return floatingIpAddress;
75     }
76
77     public void setFloatingIpAddress(String floatingIpAddress) {
78         this.floatingIpAddress = floatingIpAddress;
79     }
80
81     public void setRouterUUID(String routerUUID) {
82         this.routerUUID = routerUUID;
83     }
84
85     public String getStatus() {
86         return status;
87     }
88
89     public void setStatus(String status) {
90         this.status = status;
91     }
92
93     @Override
94     protected boolean extractField(String field, NeutronFloatingIp ans) {
95         switch (field) {
96             case "floating_network_id":
97                 ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID());
98                 break;
99             case "port_id":
100                 ans.setPortUUID(this.getPortUUID());
101                 break;
102             case "fixed_ip_address":
103                 ans.setFixedIpAddress(this.getFixedIpAddress());
104                 break;
105             case "floating_ip_address":
106                 ans.setFloatingIpAddress(this.getFloatingIpAddress());
107                 break;
108             case "router_id":
109                 ans.setRouterUUID(this.getRouterUUID());
110                 break;
111             case "status":
112                 ans.setStatus(this.getStatus());
113                 break;
114             default:
115                 return super.extractField(field, ans);
116         }
117         return true;
118     }
119
120     @Override
121     public String toString() {
122         return "NeutronFloatingIp{" + "fipUUID='" + uuid + '\'' + ", fipFloatingNetworkId='" + floatingNetworkUUID
123                 + '\'' + ", fipPortUUID='" + portUUID + '\'' + ", fipFixedIpAddress='" + fixedIpAddress + '\''
124                 + ", fipFloatingIpAddress=" + floatingIpAddress + ", fipTenantId='" + tenantID + '\''
125                 + ", fipRouterId='" + routerUUID + '\'' + ", fipStatus='" + status + '\'' + '}';
126     }
127 }