Committed by
Brian O'Connor
Add toString() method to IntentData for debugging
Change-Id: Ie7787b87df17edf342233980431d87fbb01568c7
Showing
1 changed file
with
10 additions
and
0 deletions
... | @@ -15,6 +15,7 @@ | ... | @@ -15,6 +15,7 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.net.intent; | 16 | package org.onosproject.net.intent; |
17 | 17 | ||
18 | +import com.google.common.base.MoreObjects; | ||
18 | import com.google.common.collect.ImmutableList; | 19 | import com.google.common.collect.ImmutableList; |
19 | import org.onosproject.store.Timestamp; | 20 | import org.onosproject.store.Timestamp; |
20 | 21 | ||
... | @@ -103,4 +104,13 @@ public class IntentData { //FIXME need to make this "immutable" | ... | @@ -103,4 +104,13 @@ public class IntentData { //FIXME need to make this "immutable" |
103 | return Objects.equals(this.intent, other.intent) | 104 | return Objects.equals(this.intent, other.intent) |
104 | && Objects.equals(this.version, other.version); | 105 | && Objects.equals(this.version, other.version); |
105 | } | 106 | } |
107 | + | ||
108 | + public String toString() { | ||
109 | + return MoreObjects.toStringHelper(getClass()) | ||
110 | + .add("key", key()) | ||
111 | + .add("state", state()) | ||
112 | + .add("version", version()) | ||
113 | + .toString(); | ||
114 | + } | ||
115 | + | ||
106 | } | 116 | } | ... | ... |
-
Please register or login to post a comment