neutorn-spi: remove neutron prefix of field
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronL2gateway.java
1 /*
2  * Copyright (c) 2015 Hewlett-Packard Development Company, L.P. 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 java.io.Serializable;
12 import java.util.ArrayList;
13 import java.util.List;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement(name = "l2gateway")
18 public final class NeutronL2gateway extends NeutronBaseAttributes<NeutronL2gateway>
19         implements Serializable {
20     private static final long serialVersionUID = 1L;
21
22     @XmlElement(name = "devices")
23     List<NeutronL2gatewayDevice> l2gatewayDevices;
24
25     public List<NeutronL2gatewayDevice> getNeutronL2gatewayDevices() {
26         return l2gatewayDevices;
27     }
28
29     public void setNeutronL2gatewayDevices(List<NeutronL2gatewayDevice> l2gatewayDevices) {
30         this.l2gatewayDevices = l2gatewayDevices;
31     }
32
33     public NeutronL2gateway extractFields(List<String> fields) {
34         NeutronL2gateway ans = new NeutronL2gateway();
35         for (String s : fields) {
36             extractField(s, ans);
37             if (s.equals("devices")) {
38                 List<NeutronL2gatewayDevice> devices = new ArrayList<NeutronL2gatewayDevice>();
39                 devices.addAll(this.getNeutronL2gatewayDevices());
40                 ans.setNeutronL2gatewayDevices(devices);
41             }
42         }
43         return ans;
44     }
45
46     @Override
47     public String toString() {
48         return "NeutronL2Gateway [" + "id = " + uuid + ", name = " + name + ", tenant_id = " + tenantID
49                 + ", devices = " + l2gatewayDevices + "]";
50     }
51
52 }