X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fmatch%2FMatchField.java;h=554d7e2fb3df93564cc7575fe6a83486deaa131f;hb=9438cd96bbebb06f5b67c81f313eacd6e382f0d7;hp=4f3cbbd54b81967285e0dd2924bb1e57df2bb1f9;hpb=b8bb7db7c6133e00046e85ead70426eb1e05184d;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchField.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchField.java index 4f3cbbd54b..554d7e2fb3 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchField.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchField.java @@ -32,7 +32,7 @@ public class MatchField implements Cloneable, Serializable { private Object value; // the value of the field we want to match private Object mask; // the value of the mask we want to match on the // specified field - private transient boolean isValid; + private boolean isValid; // To satisfy JAXB @SuppressWarnings("unused") @@ -177,6 +177,8 @@ public class MatchField implements Cloneable, Serializable { cloned.mask = ((byte[]) this.mask).clone(); } } + cloned.type = this.type; + cloned.isValid = this.isValid; } catch (CloneNotSupportedException e) { logger.error("", e); } @@ -185,7 +187,8 @@ public class MatchField implements Cloneable, Serializable { @Override public String toString() { - return type + "(" + getValueString() + "," + getMaskString() + ")"; + return (mask == null) ? String.format("%s(%s)", getTypeString(), getValueString()) : + String.format("%s(%s,%s)", getTypeString(), getValueString(), getMaskString()); } @Override @@ -208,6 +211,6 @@ public class MatchField implements Cloneable, Serializable { if (type != other.type) { return false; } - return (type.equalValues(this.value, other.value) && type.equalMasks(this.mask, other.mask)); + return type.equals(this.value, other.value, this.mask, other.mask); } }