Fix FindBugs violations
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronTapFlow.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 javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 @XmlRootElement
17 @XmlAccessorType(XmlAccessType.NONE)
18 public final class NeutronTapFlow extends NeutronBaseAttributes<NeutronTapFlow> {
19     private static final long serialVersionUID = 1L;
20
21     @XmlElement(name = "tap_service_id")
22     String tapServiceID;
23
24     @XmlElement(name = "direction")
25     String tapFlowDirection;
26
27     @XmlElement(name = "source_port")
28     String tapFlowSourcePort;
29
30     public String getTapFlowServiceID() {
31         return tapServiceID;
32     }
33
34     public void setTapFlowServiceID(String tapService) {
35         this.tapServiceID = tapService;
36     }
37
38     public String getTapFlowDirection() {
39         return tapFlowDirection;
40     }
41
42     public void setTapFlowDirection(String direction) {
43         this.tapFlowDirection = direction;
44     }
45
46     public String getTapFlowSourcePort() {
47         return tapFlowSourcePort;
48     }
49
50     public void setTapFlowSourcePort(String sourcePort) {
51         this.tapFlowSourcePort = sourcePort;
52     }
53
54     @Override
55     protected boolean extractField(String field, NeutronTapFlow ans) {
56         switch (field) {
57             case "source_port":
58                 ans.setTapFlowSourcePort(this.getTapFlowSourcePort());
59                 break;
60             case "direction":
61                 ans.setTapFlowDirection(this.getTapFlowDirection());
62                 break;
63             case "tap_service_id":
64                 ans.setTapFlowServiceID(this.getTapFlowServiceID());
65                 break;
66             default:
67                 return super.extractField(field, ans);
68         }
69         return true;
70     }
71
72     @Override
73     public String toString() {
74         return "NeutronTapFlow[" + "tapFlowUUID='" + uuid + '\'' + ", tapFlowTenantID='" + tenantID + '\''
75                 + ", tapFlowName='" + name + '\'' + ", tapFlowServiceID='" + tapServiceID + '\''
76                 + ", tapFlowSourcePort='" + tapFlowSourcePort + '\''
77                 + ", tapFlowDirection='" + tapFlowDirection + '\'' + ']';
78     }
79 }