Fix FindBugs violations
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronFirewallPolicy.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.  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 /**
17  * OpenStack Neutron v2.0 Firewall as a service
18  * (FWaaS) bindings. See OpenStack Network API
19  * v2.0 Reference for description of  the fields.
20  * The implemented fields are as follows:
21  *
22  * <p>
23  * id             uuid-str
24  * tenant_id      uuid-str
25  * name           String
26  * shared         Boolean
27  * audited        Boolean
28  * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
29  *
30  */
31
32 @XmlRootElement
33 @XmlAccessorType(XmlAccessType.NONE)
34 public final class NeutronFirewallPolicy extends NeutronBaseAttributes<NeutronFirewallPolicy> {
35     private static final long serialVersionUID = 1L;
36
37     @XmlElement(defaultValue = "false", name = "shared")
38     Boolean firewallPolicyIsShared;
39
40     @XmlElement(defaultValue = "false", name = "audited")
41     Boolean firewallPolicyIsAudited;
42
43     public Boolean getFirewallPolicyIsAudited() {
44         return firewallPolicyIsAudited;
45     }
46
47     public void setFirewallPolicyIsAudited(Boolean firewallPolicyIsAudited) {
48         this.firewallPolicyIsAudited = firewallPolicyIsAudited;
49     }
50
51     public Boolean getFirewallPolicyIsShared() {
52         return firewallPolicyIsShared;
53     }
54
55     public void setFirewallPolicyIsShared(Boolean firewallPolicyIsShared) {
56         this.firewallPolicyIsShared = firewallPolicyIsShared;
57     }
58
59     @Override
60     protected boolean extractField(String field, NeutronFirewallPolicy ans) {
61         switch (field) {
62             case "shared":
63                 ans.setFirewallPolicyIsShared(firewallPolicyIsShared);
64                 break;
65             case "audited":
66                 ans.setFirewallPolicyIsAudited(firewallPolicyIsAudited);
67                 break;
68             default:
69                 return super.extractField(field, ans);
70         }
71         return true;
72     }
73
74     @Override
75     public String toString() {
76         return "NeutronFirewallPolicy{" + "firewallPolicyUUID='" + uuid + '\'' + ", firewallPolicyTenantID='" + tenantID
77                 + '\'' + ", firewallPolicyName='" + name + '\'' + ", firewallPolicyIsShared="
78                 + firewallPolicyIsShared + ", firewallPolicyIsAudited='" + firewallPolicyIsAudited + '\'' + '}';
79     }
80 }