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.Iterator;
14 import java.util.List;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
19 @XmlRootElement(name = "l2gateway")
20 public class NeutronL2gateway extends NeutronObject implements Serializable, INeutronObject{
21 private static final long serialVersionUID = 1L;
23 @XmlElement(name = "name")
26 @XmlElement(name = "devices")
27 List<NeutronL2gatewayDevice> neutronL2gatewayDevices;
29 public String getL2gatewayName() {
33 public void setL2gatewayName(String l2gatewayName) {
34 this.l2gatewayName = l2gatewayName;
37 public List<NeutronL2gatewayDevice> getNeutronL2gatewayDevices() {
38 return neutronL2gatewayDevices;
41 public void setNeutronL2gatewayDevices(List<NeutronL2gatewayDevice> neutronL2gatewayDevices) {
42 this.neutronL2gatewayDevices = neutronL2gatewayDevices;
45 public NeutronL2gateway extractFields(List<String> fields) {
46 NeutronL2gateway ans = new NeutronL2gateway();
47 Iterator<String> i = fields.iterator();
51 ans.setID(this.getID());
53 if (s.equals("name")) {
54 ans.setL2gatewayName(this.getL2gatewayName());
56 if (s.equals("tenant_id")) {
57 ans.setTenantID(this.getTenantID());
59 if (s.equals("devices")) {
60 List<NeutronL2gatewayDevice> devices = new ArrayList<NeutronL2gatewayDevice>();
61 devices.addAll(this.getNeutronL2gatewayDevices());
62 ans.setNeutronL2gatewayDevices(devices);
69 public String toString() {
70 return "NeutronL2Gateway [" +
72 ", name = " + l2gatewayName +
73 ", tenant_id = " + tenantID +
74 ", devices = " + neutronL2gatewayDevices +