Jonathan Hart

Implement toString for DefaultTrafficSelector and DefaultTrafficTreatment

Change-Id: I4e9348795855bd667e8931da161427cd4a450d44
package org.onlab.onos.net.flow;
import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.onlab.onos.net.PortNumber;
import org.onlab.onos.net.flow.criteria.Criteria;
import org.onlab.onos.net.flow.criteria.Criterion;
......@@ -8,10 +12,8 @@ import org.onlab.packet.IpPrefix;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
/**
* Default traffic selector implementation.
......@@ -52,6 +54,13 @@ public final class DefaultTrafficSelector implements TrafficSelector {
return false;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("criteria", criteria)
.toString();
}
/**
* Returns a new traffic selector builder.
*
......
package org.onlab.onos.net.flow;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import org.onlab.onos.net.PortNumber;
import org.onlab.onos.net.flow.instructions.Instruction;
import org.onlab.onos.net.flow.instructions.Instructions;
......@@ -7,12 +11,9 @@ import org.onlab.packet.IpPrefix;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
/**
* Default traffic treatment implementation.
*/
......@@ -62,6 +63,13 @@ public final class DefaultTrafficTreatment implements TrafficTreatment {
return false;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("instructions", instructions)
.toString();
}
/**
* Builds a list of treatments following the following order.
* Modifications -> Group -> Output (including drop)
......