public class ContextBatchOperations extends Object
| Constructor and Description |
|---|
ContextBatchOperations() |
| Modifier and Type | Method and Description |
|---|---|
ContextBatch |
merge(Collection<ContextBatch> batchesToMerge)
Merges context batches into a single context batch.
|
ContextBatch |
subtract(ContextBatch operand,
Collection<ContextBatch> batchesToSubtract)
Subtract ContextBatches from the supplied operand, creating a new ContextBatch (unless there are no
batches to subtract in which case the supplied operand is returned unchanged).
|
public ContextBatch merge(Collection<ContextBatch> batchesToMerge)
Note:you can only merge batches if all batches do not
have any excluded contexts. The problem is that with excluded contexts you can't know
if the batch you are merging with should have resources (and resource parameters)
removed and you are therefore going to end up with a merged batch with a potentially
wrong hash. (See ContextBatch)
batchesToMerge - - one or more batches to merge togetherIllegalArgumentException - if any of the batches have excludedContextspublic ContextBatch subtract(ContextBatch operand, Collection<ContextBatch> batchesToSubtract)
Subtraction for a ContextBatch means the removal of any WebResourceModuleDescriptor that exist within the ContextBatch being subtracted. Consequently it also means that some PluginResourceBatchParams may also be removed (if there is no longer an applicable PluginResource).
Note:you can only subtract batches if all batches do not have any excluded contexts. The problem is that with excluded contexts you end up with the possibility of subtracting a subtracted context. And since the already subtracted context no longer has reference to the WebResourceModuleDescriptor it caused to be removed you cannot ensure that the resultant ContextBatch also has them removed.
operand - the ContextBatch to be operated uponbatchesToSubtract - the ContextBatches to be subtracted.IllegalArgumentException - if any of the batchesToSubtract already have excluded contexts.Copyright © 2019 Atlassian. All rights reserved.