pretty builders
Change-Id: If03b60f97be1eba3803c6fcb328196a4a195c7e8
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/TrafficTreatment.java b/core/api/src/main/java/org/onlab/onos/net/flow/TrafficTreatment.java
index 068bc2c..fe21328 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/TrafficTreatment.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/TrafficTreatment.java
@@ -2,7 +2,11 @@
import java.util.List;
+import org.onlab.onos.net.PortNumber;
import org.onlab.onos.net.flow.instructions.Instruction;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
/**
* Abstraction of network traffic treatment.
@@ -22,14 +26,67 @@
public interface Builder {
/**
- * Adds a traffic treatment instruction. If a same type instruction has
- * already been added, it will be replaced by this one.
- *
- * @param instruction new instruction
+ * Adds an instruction to the builder.
+ * @param instruction an instruction
+ * @return a treatment builder
*/
Builder add(Instruction instruction);
/**
+ * Adds a drop instruction and does not return a builder.
+ */
+ public void drop();
+
+ /**
+ * Set the output port.
+ * @param number the out port
+ * @return a treatment builder
+ */
+ public Builder setOutput(PortNumber number);
+
+ /**
+ * Sets the src l2 address.
+ * @param addr a macaddress
+ * @return a treatment builder
+ */
+ public Builder setEthSrc(MacAddress addr);
+
+ /**
+ * Sets the dst l2 address.
+ * @param addr a macaddress
+ * @return a treatment builder
+ */
+ public Builder setEthDst(MacAddress addr);
+
+ /**
+ * Sets the vlan id.
+ * @param id a vlanid
+ * @return a treatment builder
+ */
+ public Builder setVlanId(VlanId id);
+
+ /**
+ * Sets the vlan priority.
+ * @param pcp a vlan priority
+ * @return a treatment builder
+ */
+ public Builder setVlanPcp(Byte pcp);
+
+ /**
+ * Sets the src l3 address.
+ * @param addr an ip
+ * @return a treatment builder
+ */
+ public Builder setIpSrc(IpPrefix addr);
+
+ /**
+ * Sets the dst l3 address.
+ * @param addr an ip
+ * @return a treatment builder
+ */
+ public Builder setIpDst(IpPrefix addr);
+
+ /**
* Builds an immutable traffic treatment descriptor.
*
* @return traffic treatment