Package org.onosproject.net.flow
Class BatchOperation<T extends BatchOperationEntry<?,?>>
- java.lang.Object
-
- org.onosproject.net.flow.BatchOperation<T>
-
- Type Parameters:
T
- the enum of operators
This enum must be defined in each sub-classes.
- Direct Known Subclasses:
FlowRuleBatchOperation
public abstract class BatchOperation<T extends BatchOperationEntry<?,?>> extends java.lang.Object
A list of BatchOperationEntry.
-
-
Constructor Summary
Constructors Constructor Description BatchOperation()
Creates newBatchOperation
object.BatchOperation(java.util.Collection<T> batchOperations)
CreatesBatchOperation
object from a list of batch operation entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAll(BatchOperation<T> another)
Add all operations from another batch to this batch.BatchOperation<T>
addOperation(T entry)
Adds an operation.void
clear()
Removes all operations maintained in this object.boolean
equals(java.lang.Object o)
java.util.List<T>
getOperations()
Returns the operations in this object.int
hashCode()
int
size()
Returns the number of operations in this object.java.lang.String
toString()
-
-
-
Constructor Detail
-
BatchOperation
public BatchOperation()
Creates newBatchOperation
object.
-
BatchOperation
public BatchOperation(java.util.Collection<T> batchOperations)
CreatesBatchOperation
object from a list of batch operation entries.- Parameters:
batchOperations
- the list of batch operation entries.
-
-
Method Detail
-
clear
public void clear()
Removes all operations maintained in this object.
-
size
public int size()
Returns the number of operations in this object.- Returns:
- the number of operations in this object
-
getOperations
public java.util.List<T> getOperations()
Returns the operations in this object.- Returns:
- the operations in this object
-
addOperation
public BatchOperation<T> addOperation(T entry)
Adds an operation. FIXME: Brian promises that the Intent Framework will not modify the batch operation after it has submitted it. Ali would prefer immutablity, but trusts brian for better or for worse.- Parameters:
entry
- the operation to be added- Returns:
- this object if succeeded, null otherwise
-
addAll
public boolean addAll(BatchOperation<T> another)
Add all operations from another batch to this batch.- Parameters:
another
- another batch- Returns:
- true if success
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-