Define ID representation for Intent, IFlow and MatchAction
- Defines BatchOperationTargetId abstract class.
- The above class is the base class of IntentId, FlowId, and MatchActionId.
-- Intent objects use IntentId class for its ID.
-- IFlow objects use FlowId class for its ID.
-- MatchAction objects use MatchActionId class for its ID.
- BatchOperation classes requires the BatchOperationTargetId as the target object's ID.
- This work is a part of ONOS-1758.
Change-Id: I71bb4e6acd3836d1ced3beb6fb331bca451abdc3
diff --git a/src/main/java/net/onrc/onos/core/matchaction/MatchActionId.java b/src/main/java/net/onrc/onos/core/matchaction/MatchActionId.java
new file mode 100644
index 0000000..d4acae6
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/matchaction/MatchActionId.java
@@ -0,0 +1,31 @@
+package net.onrc.onos.core.matchaction;
+
+import net.onrc.onos.api.batchoperation.BatchOperationTargetId;
+
+public class MatchActionId extends BatchOperationTargetId {
+ private final String value;
+
+ public MatchActionId(String id) {
+ value = id;
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof MatchActionId) {
+ MatchActionId other = (MatchActionId) obj;
+ return (this.value.equals(other.value));
+ }
+ return false;
+ }
+
+}