Charles Chan
Committed by Gerrit Code Review

Override toString for flow objectives

Change-Id: I725ca9ac231e21c12f364e1a8bbdc6d3cd1e5a38
......@@ -27,6 +27,7 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
......@@ -120,7 +121,6 @@ public final class DefaultFilteringObjective implements FilteringObjective {
return context;
}
@Override
public int hashCode() {
return Objects.hash(type, permanent, timeout, appId, priority, key,
......@@ -147,6 +147,23 @@ public final class DefaultFilteringObjective implements FilteringObjective {
return false;
}
@Override
public String toString() {
return toStringHelper(this)
.add("id", id())
.add("type", type())
.add("op", op())
.add("priority", priority())
.add("key", key())
.add("conditions", conditions())
.add("meta", meta())
.add("appId", appId())
.add("permanent", permanent())
.add("timeout", timeout())
.add("context", context())
.toString();
}
/**
* Returns a new builder.
*
......
......@@ -24,6 +24,7 @@ import org.onosproject.net.flow.TrafficTreatment;
import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
......@@ -146,6 +147,23 @@ public final class DefaultForwardingObjective implements ForwardingObjective {
return false;
}
@Override
public String toString() {
return toStringHelper(this)
.add("id", id())
.add("op", op())
.add("priority", priority())
.add("selector", selector())
.add("treatment", treatment())
.add("nextId", nextId())
.add("flag", flag())
.add("appId", appId())
.add("permanent", permanent())
.add("timeout", timeout())
.add("context", context())
.toString();
}
/**
* Returns a new builder.
*
......
......@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
......@@ -125,6 +126,22 @@ public final class DefaultNextObjective implements NextObjective {
return false;
}
@Override
public String toString() {
return toStringHelper(this)
.add("id", id())
.add("type", type())
.add("op", op())
.add("priority", priority())
.add("next", next())
.add("meta", meta())
.add("appId", appId())
.add("permanent", permanent())
.add("timeout", timeout())
.add("context", context())
.toString();
}
/**
* Returns a new builder.
*
......