Add new method FlowEntry.isValidFlowId() and the corresponding unit test.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
index 9862040..03794a1 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntry.java
@@ -116,6 +116,7 @@
/**
* Get the Flow ID.
+ *
* @return the Flow ID.
*/
@JsonIgnore
@@ -131,6 +132,17 @@
}
/**
+ * Test whether the Flow ID is valid.
+ *
+ * @return true if the Flow ID is valid, otherwise false.
+ */
+ public boolean isValidFlowId() {
+ if (this.flowId == null)
+ return false;
+ return (this.flowId.value() != 0);
+ }
+
+ /**
* Get the Flow Entry ID.
*
* @return the Flow Entry ID.