2 * Copyright (c) 2013, 2015 IBM Corporation 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.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronRouterInterface extends NeutronObject<NeutronRouterInterface>
21 implements Serializable, INeutronObject<NeutronRouterInterface> {
22 private static final long serialVersionUID = 1L;
24 // See OpenStack Network API v2.0 Reference for description of
25 // annotated attributes
27 @XmlElement(name = "subnet_id")
30 @XmlElement(name = "port_id")
33 public NeutronRouterInterface() {
36 public NeutronRouterInterface(String subnetUUID, String portUUID) {
37 this.subnetUUID = subnetUUID;
38 this.portUUID = portUUID;
41 public String getSubnetUUID() {
45 public void setSubnetUUID(String subnetUUID) {
46 this.subnetUUID = subnetUUID;
49 public String getPortUUID() {
53 public void setPortUUID(String portUUID) {
54 this.portUUID = portUUID;
58 public NeutronRouterInterface extractFields(List<String> fields) {
59 NeutronRouterInterface ans = new NeutronRouterInterface();
60 for (String s : fields) {
62 if (s.equals("subnet_id")) {
63 ans.setSubnetUUID(this.getSubnetUUID());
65 if (s.equals("port_id")) {
66 ans.setPortUUID(this.getPortUUID());
73 public String toString() {
74 return "NeutronRouterInterface [" + "subnetUUID=" + subnetUUID + ", portUUID=" + portUUID + ", id=" + uuid
75 + ", tenantID=" + tenantID + "]";