Implement toString in RouteSet and RouteInfo
Change-Id: I35a5f0f3245c05809ace0bf6eedb745d12f50cd5
diff --git a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteInfo.java b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteInfo.java
index 0969162..c479fca 100644
--- a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteInfo.java
+++ b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteInfo.java
@@ -17,6 +17,7 @@
package org.onosproject.routeservice;
import com.google.common.annotations.Beta;
+import com.google.common.base.MoreObjects;
import org.onlab.packet.IpPrefix;
import java.util.Objects;
@@ -97,4 +98,13 @@
Objects.equals(this.bestRoute, that.bestRoute) &&
Objects.equals(this.allRoutes, that.allRoutes);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(RouteSet.class)
+ .add("prefix", prefix)
+ .add("bestRoute", bestRoute)
+ .add("allRoutes", allRoutes)
+ .toString();
+ }
}
diff --git a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteSet.java b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteSet.java
index f464e5d..387dc73 100644
--- a/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteSet.java
+++ b/apps/route-service/api/src/main/java/org/onosproject/routeservice/RouteSet.java
@@ -16,6 +16,7 @@
package org.onosproject.routeservice;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import org.onlab.packet.IpPrefix;
@@ -94,4 +95,13 @@
Objects.equals(this.prefix, that.prefix) &&
Objects.equals(this.routes, that.routes);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(RouteSet.class)
+ .add("tableId", tableId)
+ .add("prefix", prefix)
+ .add("routes", routes)
+ .toString();
+ }
}