Make use of NetUtils.getBroadcastMacAddr()
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / match / MatchField.java
index 3b8a2952164eafb0cf463208d06cc29a182e2d6f..554d7e2fb3df93564cc7575fe6a83486deaa131f 100644 (file)
@@ -9,6 +9,7 @@
 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;
@@ -31,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")
@@ -176,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);
         }
@@ -184,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