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)
13 public class TpSrc extends MatchField<Short> {
14 private static final long serialVersionUID = 1L;
15 public static final String TYPE = "TP_SRC";
19 * Creates a Match field for the Transport source port
24 public TpSrc(short port) {
35 public Short getValue() {
40 @XmlElement(name = "value")
41 protected String getValueString() {
42 return String.valueOf(NetUtils.getUnsignedShort(port));
46 public Short getMask() {
51 protected String getMaskString() {
56 public boolean isValid() {
61 public boolean hasReverse() {
66 public TpDst getReverse() {
67 return new TpDst(port);
71 public TpSrc clone() {
72 return new TpSrc(port);
76 public boolean isV6() {
81 public int hashCode() {
83 int result = super.hashCode();
84 result = prime * result + port;
89 public boolean equals(Object obj) {
93 if (!super.equals(obj)) {
96 if (!(obj instanceof TpSrc)) {
99 TpSrc other = (TpSrc) obj;
100 if (port != other.port) {