Fix FindBugs violations
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVpnService.java
1 /*
2  * Copyright (c) 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 NeutronVpnService extends NeutronAdminAttributes<NeutronVpnService> {
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 = "router_id")
25     String routerUUID;
26
27     @XmlElement(name = "subnet_id")
28     String subnetUUID;
29
30     public NeutronVpnService() {
31     }
32
33     public String getRouterUUID() {
34         return routerUUID;
35     }
36
37     public void setRouterUUID(String routerUUID) {
38         this.routerUUID = routerUUID;
39     }
40
41     public String getSubnetUUID() {
42         return subnetUUID;
43     }
44
45     public void setSubnetUUID(String subnetUUID) {
46         this.subnetUUID = subnetUUID;
47     }
48
49     @Override
50     protected boolean extractField(String field, NeutronVpnService ans) {
51         switch (field) {
52             case "router_id":
53                 ans.setRouterUUID(this.getRouterUUID());
54                 break;
55             case "subnet_id":
56                 ans.setSubnetUUID(this.getSubnetUUID());
57                 break;
58             default:
59                 return super.extractField(field, ans);
60         }
61         return true;
62     }
63 }