tapaas: tapaas support
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronTapService.java
1 /*
2  * Copyright (c) 2017 Intel Corporation.  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 javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronTapService extends NeutronBaseAttributes<NeutronTapService> implements Serializable {
20     private static final long serialVersionUID = 1L;
21
22     @XmlElement(name = "port_id")
23     String tapServicePortID;
24
25     public String getTapServicePortID() {
26         return tapServicePortID;
27     }
28
29     public void setTapServicePortID(String port) {
30         this.tapServicePortID = port;
31     }
32
33     @Override
34     protected boolean extractField(String field, NeutronTapService ans) {
35         switch (field) {
36             case "port_id":
37                 ans.setTapServicePortID(this.getTapServicePortID());
38                 break;
39             default:
40                 return super.extractField(field, ans);
41         }
42         return true;
43     }
44
45     @Override
46     public String toString() {
47         return "NeutronTapService[" + "tapServiceUUID='" + uuid + '\'' + ", tapServiceTenantID='"
48                 + tenantID + '\'' + ", tapServiceName='" + name + '\'' + ", tapServicePortID='"
49                 + tapServicePortID + '\'' + ']';
50     }
51 }