Fix FindBugs violations
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / NeutronFirewallRuleRequest.java
index ad2b469921e774235abfcf226905120fceae577c..c5bab0b374b7dae6018f657cab773e8bb83aa213 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Red Hat, Inc.
+ * Copyright (c) 2014, 2015 Red Hat, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,33 +8,28 @@
 
 package org.opendaylight.neutron.northbound.api;
 
-import org.opendaylight.neutron.spi.NeutronFirewallRule;
-
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
+import org.opendaylight.neutron.spi.NeutronFirewallRule;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronFirewallRuleRequest {
+@SuppressFBWarnings("URF_UNREAD_FIELD")
+public final class NeutronFirewallRuleRequest implements INeutronRequest<NeutronFirewallRule> {
     /**
-     * See OpenStack Network API v2.0 Reference for description of
+     * See OpenStack Network API v2.0 Reference for description of the following link.
      * http://docs.openstack.org/api/openstack-network/2.0/content/
      *
-     * Deprecated as all Neutron FWaaS is experimental and so doesn't meet 
-     * the scope of neutron northbound
-     *
-     * @deprecated
      */
 
-    @XmlElement(name="firewall_rule")
-    NeutronFirewallRule singletonFirewallRule;
+    @XmlElement(name = "firewall_rule")
+    NeutronFirewallRule singleton;
 
-    @XmlElement(name="firewall_rules")
+    @XmlElement(name = "firewall_rules")
     List<NeutronFirewallRule> bulkRequest;
 
     NeutronFirewallRuleRequest() {
@@ -42,22 +37,9 @@ public class NeutronFirewallRuleRequest {
 
     NeutronFirewallRuleRequest(List<NeutronFirewallRule> bulk) {
         bulkRequest = bulk;
-        singletonFirewallRule = null;
     }
 
     NeutronFirewallRuleRequest(NeutronFirewallRule group) {
-        singletonFirewallRule = group;
-    }
-
-    public List<NeutronFirewallRule> getBulk() {
-        return bulkRequest;
-    }
-
-    public NeutronFirewallRule getSingleton() {
-        return singletonFirewallRule;
-    }
-
-    public boolean isSingleton() {
-        return (singletonFirewallRule != null);
+        singleton = group;
     }
 }