Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / match / extensible / InPort.java
1 package org.opendaylight.controller.sal.match.extensible;
2
3 import javax.xml.bind.annotation.XmlAccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlElement;
6 import javax.xml.bind.annotation.XmlRootElement;
7
8 import org.opendaylight.controller.sal.core.NodeConnector;
9
10 @XmlRootElement
11 @XmlAccessorType(XmlAccessType.NONE)
12 @Deprecated
13 public class InPort extends MatchField<NodeConnector> {
14     private static final long serialVersionUID = 1L;
15     public static final String TYPE = "IN_PORT";
16     private NodeConnector port;
17
18     /**
19      * Creates a Match field for the input port
20      *
21      * @param port
22      *            the input port
23      */
24     public InPort(NodeConnector port) {
25         super(TYPE);
26         this.port = port;
27     }
28
29     // To satisfy JAXB
30     private InPort() {
31         super(TYPE);
32     }
33
34     @Override
35     public NodeConnector getValue() {
36         return port;
37     }
38
39     @Override
40     @XmlElement(name = "value")
41     protected String getValueString() {
42         return port.toString();
43     }
44
45     @Override
46     public NodeConnector getMask() {
47         return null;
48     }
49
50     @Override
51     protected String getMaskString() {
52         return null;
53     }
54
55     @Override
56     public boolean isValid() {
57         return true;
58     }
59
60     @Override
61     public boolean hasReverse() {
62         return false;
63     }
64
65     @Override
66     public InPort getReverse() {
67         return this.clone();
68     }
69
70     @Override
71     public InPort clone() {
72         return new InPort(port);
73     }
74
75     @Override
76     public boolean isV6() {
77         return true;
78     }
79
80     @Override
81     public int hashCode() {
82         final int prime = 31;
83         int result = 1;
84         result = prime * result + ((port == null) ? 0 : port.hashCode());
85         return result;
86     }
87
88     @Override
89     public boolean equals(Object obj) {
90         if (this == obj) {
91             return true;
92         }
93         if (obj == null) {
94             return false;
95         }
96         if (!(obj instanceof InPort)) {
97             return false;
98         }
99         InPort other = (InPort) obj;
100         if (port == null) {
101             if (other.port != null) {
102                 return false;
103             }
104         } else if (!port.equals(other.port)) {
105             return false;
106         }
107         return true;
108     }
109 }