commit | d423ac13bbc2619ebf33431be4b55cb556e131d7 | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@onlab.us> | Fri Aug 29 22:09:23 2014 -0700 |
committer | Saurav Das <sauravdas@alumni.stanford.edu> | Fri Sep 05 11:47:25 2014 -0700 |
tree | c96f950fd4224b8819677ffb4ac5666ecc5cb750 | |
parent | 06518457d461416e3b41b1986c90f315fd93c40e [diff] |
Add a method to concatenate 2 TopologyBatchOperations. Part of ONOS-1925 Change-Id: Iaa5eb561cf40491b83477bb5d46b6ebec4fec162
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java b/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java index f7d7049..e8dcec7 100644 --- a/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java +++ b/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java
@@ -49,4 +49,17 @@ new BatchOperationEntry<Operator, TopologyEvent>( Operator.REMOVE, topologyEvent)); } + + /** + * Concatenates specified TopologyBatchOperation. + * + * @param ops TopologyBatchOperation to concatenate. + * @return this + */ + public TopologyBatchOperation concat(final TopologyBatchOperation ops) { + for (BatchOperationEntry<Operator, TopologyEvent> e : ops.getOperations()) { + this.addOperation(e); + } + return this; + } }