Fix FindBugs violations
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVpnIpSecPolicy.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 NeutronVpnIpSecPolicy extends NeutronBaseAttributes<NeutronVpnIpSecPolicy> {
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 = "transform_protocol")
25     String transformProtocol;
26
27     @XmlElement(name = "encapsulation_mode")
28     String encapsulationMode;
29
30     @XmlElement(name = "auth_algorithm")
31     String authAlgorithm;
32
33     @XmlElement(name = "encryption_algorithm")
34     String encryptionAlgorithm;
35
36     @XmlElement(name = "pfs")
37     String perfectForwardSecrecy;
38
39     @XmlElement(name = "lifetime")
40     NeutronVpnLifetime lifetime;
41
42     public NeutronVpnIpSecPolicy() {
43     }
44
45     public String getTransformProtocol() {
46         return transformProtocol;
47     }
48
49     public void setTransformProtocol(String transformProtocol) {
50         this.transformProtocol = transformProtocol;
51     }
52
53     public String getEncapsulationMode() {
54         return encapsulationMode;
55     }
56
57     public void setEncapsulationMode(String encapsulationMode) {
58         this.encapsulationMode = encapsulationMode;
59     }
60
61     public String getAuthAlgorithm() {
62         return authAlgorithm;
63     }
64
65     public void setAuthAlgorithm(String authAlgorithm) {
66         this.authAlgorithm = authAlgorithm;
67     }
68
69     public String getEncryptionAlgorithm() {
70         return encryptionAlgorithm;
71     }
72
73     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
74         this.encryptionAlgorithm = encryptionAlgorithm;
75     }
76
77     public String getPerfectForwardSecrecy() {
78         return perfectForwardSecrecy;
79     }
80
81     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
82         this.perfectForwardSecrecy = perfectForwardSecrecy;
83     }
84
85     public NeutronVpnLifetime getLifetime() {
86         return lifetime;
87     }
88
89     public void setLifetime(NeutronVpnLifetime lifetime) {
90         this.lifetime = lifetime;
91     }
92
93     @Override
94     protected boolean extractField(String field, NeutronVpnIpSecPolicy ans) {
95         switch (field) {
96             case "transform_protocol":
97                 ans.setTransformProtocol(this.getTransformProtocol());
98                 break;
99             case "encapsulation_mode":
100                 ans.setEncapsulationMode(this.getEncapsulationMode());
101                 break;
102             case "auth_algorithm":
103                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
104                 break;
105             case "encryption_algorithm":
106                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
107                 break;
108             case "pfs":
109                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
110                 break;
111             default:
112                 return super.extractField(field, ans);
113         }
114         return true;
115     }
116
117 }