Add toString() method to IntentData for debugging
Change-Id: Ie7787b87df17edf342233980431d87fbb01568c7
diff --git a/core/api/src/main/java/org/onosproject/net/intent/IntentData.java b/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
index 0abfd12..ce64ecc 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/IntentData.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import org.onosproject.store.Timestamp;
@@ -103,4 +104,13 @@
return Objects.equals(this.intent, other.intent)
&& Objects.equals(this.version, other.version);
}
+
+ public String toString() {
+ return MoreObjects.toStringHelper(getClass())
+ .add("key", key())
+ .add("state", state())
+ .add("version", version())
+ .toString();
+ }
+
}