Merge "Integration of MDSAL into distribution"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / match / MatchField.java
index 4f3cbbd54b81967285e0dd2924bb1e57df2bb1f9..54be4c67189412a208dc5cfebb6fef2ff49f0301 100644 (file)
@@ -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);
     }
 }