checkstyle: enable JavadocParagraph
[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 java.io.Serializable;
12 import java.util.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17
18 /**
19  * OpenStack Neutron v2.0 Firewall as a service
20  * (FWaaS) bindings. See OpenStack Network API
21  * v2.0 Reference for description of  the fields.
22  * The implemented fields are as follows:
23  *
24  * <p>
25  * id             uuid-str
26  * tenant_id      uuid-str
27  * name           String
28  * shared         Boolean
29  * audited        Boolean
30  * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
31  *
32  */
33
34 @XmlRootElement
35 @XmlAccessorType(XmlAccessType.NONE)
36 public final class NeutronFirewallPolicy extends NeutronBaseAttributes<NeutronFirewallPolicy> implements Serializable {
37     private static final long serialVersionUID = 1L;
38
39     @XmlElement(defaultValue = "false", name = "shared")
40     Boolean firewallPolicyIsShared;
41
42     @XmlElement(defaultValue = "false", name = "audited")
43     Boolean firewallPolicyIsAudited;
44
45     public Boolean getFirewallPolicyIsAudited() {
46         return firewallPolicyIsAudited;
47     }
48
49     public void setFirewallPolicyIsAudited(Boolean firewallPolicyIsAudited) {
50         this.firewallPolicyIsAudited = firewallPolicyIsAudited;
51     }
52
53     public Boolean getFirewallPolicyIsShared() {
54         return firewallPolicyIsShared;
55     }
56
57     public void setFirewallPolicyIsShared(Boolean firewallPolicyIsShared) {
58         this.firewallPolicyIsShared = firewallPolicyIsShared;
59     }
60
61     public NeutronFirewallPolicy extractFields(List<String> fields) {
62         NeutronFirewallPolicy ans = new NeutronFirewallPolicy();
63         for (String s : fields) {
64             extractField(s, ans);
65             if (s.equals("shared")) {
66                 ans.setFirewallPolicyIsShared(firewallPolicyIsShared);
67             }
68             if (s.equals("audited")) {
69                 ans.setFirewallPolicyIsAudited(firewallPolicyIsAudited);
70             }
71         }
72         return ans;
73     }
74
75     @Override
76     public String toString() {
77         return "NeutronFirewallPolicy{" + "firewallPolicyUUID='" + uuid + '\'' + ", firewallPolicyTenantID='" + tenantID
78                 + '\'' + ", firewallPolicyName='" + name + '\'' + ", firewallPolicyIsShared="
79                 + firewallPolicyIsShared + ", firewallPolicyIsAudited='" + firewallPolicyIsAudited + '\'' + '}';
80     }
81 }