Add size() and getOperations() method to BatchOperation class.
This task is a part of ONOS-1692.
Change-Id: Ib8f1be30a7bc91de9c00547e9e9d8c4771099fe2
diff --git a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
index b4755e9..9fc20c0 100644
--- a/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
+++ b/src/main/java/net/onrc/onos/api/batchoperation/BatchOperation.java
@@ -1,5 +1,6 @@
package net.onrc.onos.api.batchoperation;
+import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -28,6 +29,15 @@
}
/**
+ * Returns the number of operations in this object.
+ *
+ * @return the number of operations in this object.
+ */
+ public int size() {
+ return ops.size();
+ }
+
+ /**
* Returns an iterator over the operations in this object.
*
* @return an iterator over the operations in this object.
@@ -37,6 +47,15 @@
}
/**
+ * Returns the operations in this object.
+ *
+ * @return the operations in this object.
+ */
+ public List<BatchOperationEntry> getOperations() {
+ return Collections.unmodifiableList(ops);
+ }
+
+ /**
* Adds an add-operation.
*
* @param target IBatchOperationTarget object to be added.