Adding emptyTreatment() and emptySelector()
Note: There was a change that adds a DROP action to
a traffic treatment if there are no other actions present.
To get a traffic treatment without the drop rule, use
emptyTreatment()
Change-Id: I1f23ed5e1fa7519eb94fcafa85facbad815d5e9c
diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
index 499e9e7..7249ac0 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
@@ -27,6 +27,7 @@
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -41,6 +42,9 @@
private final boolean hasClear;
+ private static final DefaultTrafficTreatment EMPTY
+ = new DefaultTrafficTreatment(Collections.emptyList());
+
/**
* Creates a new traffic treatment from the specified list of instructions.
*
@@ -99,6 +103,15 @@
}
/**
+ * Returns an empty traffic treatment.
+ *
+ * @return empty traffic treatment
+ */
+ public static TrafficTreatment emptyTreatment() {
+ return EMPTY;
+ }
+
+ /**
* Returns a new traffic treatment builder primed to produce entities
* patterned after the supplied treatment.
*