NEUTRON-208: BGPVPN network and router association
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / NeutronNetworkRequest.java
index 8a2628fdedf11a2334f3673f0bdd5556307c615c..54c51e506ea2e03581e19911d6b66eba587d8713 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright IBM Corporation, 2013.  All rights reserved.
+ * Copyright (c) 2013, 2015 IBM Corporation 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,6 +8,7 @@
 
 package org.opendaylight.neutron.northbound.api;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -17,17 +18,18 @@ import org.opendaylight.neutron.spi.NeutronNetwork;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class NeutronNetworkRequest implements INeutronRequest<NeutronNetwork> {
+@SuppressFBWarnings("URF_UNREAD_FIELD")
+public final class NeutronNetworkRequest extends NeutronRequest<NeutronNetwork> {
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement(name="network")
-    NeutronNetwork singletonNetwork;
+    @XmlElement(name = "network")
+    NeutronNetwork singleton;
 
-    @XmlElement(name="networks")
+    @XmlElement(name = "networks")
     List<NeutronNetwork> bulkRequest;
 
-    @XmlElement(name="networks_links")
+    @XmlElement(name = "networks_links")
     List<NeutronPageLink> links;
 
     NeutronNetworkRequest() {
@@ -36,30 +38,13 @@ public class NeutronNetworkRequest implements INeutronRequest<NeutronNetwork> {
     NeutronNetworkRequest(List<NeutronNetwork> bulkRequest, List<NeutronPageLink> links) {
         this.bulkRequest = bulkRequest;
         this.links = links;
-        this.singletonNetwork = null;
     }
 
     NeutronNetworkRequest(List<NeutronNetwork> bulk) {
         bulkRequest = bulk;
-        singletonNetwork = null;
     }
 
     NeutronNetworkRequest(NeutronNetwork net) {
-        singletonNetwork = net;
-    }
-
-    @Override
-    public NeutronNetwork getSingleton() {
-        return singletonNetwork;
-    }
-
-    @Override
-    public boolean isSingleton() {
-        return (singletonNetwork != null);
-    }
-
-    @Override
-    public List<NeutronNetwork> getBulk() {
-        return bulkRequest;
+        singleton = net;
     }
 }