1 package org.opendaylight.controller.sal.match.extensible;
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;
8 import org.opendaylight.controller.sal.utils.NetUtils;
11 @XmlAccessorType(XmlAccessType.NONE)
12 public class TpSrc extends MatchField<Short> {
13 private static final long serialVersionUID = 1L;
14 public static final String TYPE = "TP_SRC";
18 * Creates a Match field for the Transport source port
23 public TpSrc(short port) {
34 public Short getValue() {
39 @XmlElement(name = "value")
40 protected String getValueString() {
41 return String.valueOf(NetUtils.getUnsignedShort(port));
45 public Short getMask() {
50 protected String getMaskString() {
55 public boolean isValid() {
60 public boolean hasReverse() {
65 public TpDst getReverse() {
66 return new TpDst(port);
70 public TpSrc clone() {
71 return new TpSrc(port);
75 public boolean isV6() {
80 public int hashCode() {
82 int result = super.hashCode();
83 result = prime * result + port;
88 public boolean equals(Object obj) {
92 if (!super.equals(obj)) {
95 if (!(obj instanceof TpSrc)) {
98 TpSrc other = (TpSrc) obj;
99 if (port != other.port) {