2 * Copyright (c) 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
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
9 package org.opendaylight.neutron.spi;
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;
17 @XmlRootElement(name = "l2gateway")
18 public final class NeutronL2gateway extends NeutronBaseAttributes<NeutronL2gateway>
19 implements Serializable {
20 private static final long serialVersionUID = 1L;
22 @XmlElement(name = "devices")
23 List<NeutronL2gatewayDevice> l2gatewayDevices;
25 public List<NeutronL2gatewayDevice> getNeutronL2gatewayDevices() {
26 return l2gatewayDevices;
29 public void setNeutronL2gatewayDevices(List<NeutronL2gatewayDevice> l2gatewayDevices) {
30 this.l2gatewayDevices = l2gatewayDevices;
33 public NeutronL2gateway extractFields(List<String> fields) {
34 NeutronL2gateway ans = new NeutronL2gateway();
35 for (String s : fields) {
37 if (s.equals("devices")) {
38 List<NeutronL2gatewayDevice> devices = new ArrayList<NeutronL2gatewayDevice>();
39 devices.addAll(this.getNeutronL2gatewayDevices());
40 ans.setNeutronL2gatewayDevices(devices);
47 public String toString() {
48 return "NeutronL2Gateway [" + "id = " + uuid + ", name = " + name + ", tenant_id = " + tenantID
49 + ", devices = " + l2gatewayDevices + "]";