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.util.ArrayList;
12 import java.util.List;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
16 @XmlRootElement(name = "l2gateway")
17 public final class NeutronL2gateway extends NeutronBaseAttributes<NeutronL2gateway> {
18 private static final long serialVersionUID = 1L;
20 @XmlElement(name = "devices")
21 List<NeutronL2gatewayDevice> l2gatewayDevices;
23 public List<NeutronL2gatewayDevice> getNeutronL2gatewayDevices() {
24 return l2gatewayDevices;
27 public void setNeutronL2gatewayDevices(List<NeutronL2gatewayDevice> newL2gatewayDevices) {
28 this.l2gatewayDevices = newL2gatewayDevices;
32 protected boolean extractField(String field, NeutronL2gateway ans) {
35 List<NeutronL2gatewayDevice> devices = new ArrayList<>();
36 devices.addAll(this.getNeutronL2gatewayDevices());
37 ans.setNeutronL2gatewayDevices(devices);
40 return super.extractField(field, ans);
46 public String toString() {
47 return "NeutronL2Gateway [" + "id = " + uuid + ", name = " + name + ", tenant_id = " + tenantID
48 + ", devices = " + l2gatewayDevices + "]";