X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fmatch%2FMatchField.java;h=54be4c67189412a208dc5cfebb6fef2ff49f0301;hp=4f3cbbd54b81967285e0dd2924bb1e57df2bb1f9;hb=68ef34f0d8f426ce525ccefb4e5a36162f2eb717;hpb=400baaf54049cf4d6159e7c03b7c6e724eaa5aa5 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..54be4c6718 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 @@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.match; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -185,7 +184,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 +208,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); } }