Refactor NoAction class
- Move from inner class to core.matchaction.action package
- Rename from NoAction to NullAction
- Make NullAction singleton
Change-Id: I0a41c7ef984492f2b293a6df27479a4cca68a5f9
diff --git a/src/main/java/net/onrc/onos/core/matchaction/action/NullAction.java b/src/main/java/net/onrc/onos/core/matchaction/action/NullAction.java
new file mode 100644
index 0000000..3613ada
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/action/NullAction.java
@@ -0,0 +1,23 @@
+package net.onrc.onos.core.matchaction.action;
+
+/**
+ * An action which does not affect anything at all.
+ * In other words, NOP.
+ *
+ * This action can be used for intent only. Flow Manager and Match Action Manager
+ * may not handle correctly.
+ */
+public final class NullAction implements Action {
+ private static final NullAction INSTANCE = new NullAction();
+
+ private NullAction() {}
+
+ /**
+ * Returns singleton of this class.
+ *
+ * @return singleton of this class
+ */
+ static NullAction getInstance() {
+ return INSTANCE;
+ }
+}