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