public class SearchResultsBatchWorkSource<T> extends Object implements BatchableWorkSource<T>
Constructor and Description |
---|
SearchResultsBatchWorkSource(SearchManager searchManager,
List<SearchResult> searchResults,
int batchSize,
com.google.common.base.Function<com.atlassian.bonnie.Searchable,T> transformer) |
Modifier and Type | Method and Description |
---|---|
List<T> |
getBatch()
gets the list of entities that form the batch.
|
int |
getTotalSize() |
boolean |
hasMoreBatches() |
int |
numberOfBatches() |
void |
reset(int total)
Reset the work source ready to begin getting batches again.
|
public SearchResultsBatchWorkSource(SearchManager searchManager, List<SearchResult> searchResults, int batchSize, com.google.common.base.Function<com.atlassian.bonnie.Searchable,T> transformer)
searchManager
- searchResults
- batchSize
- transformer
- - the function used to transform the list of Searchables returned from the query to the type required
by the batch, may also perform filtering, so it is safe for the apply method to return null, the apply
method should also accept null values.public List<T> getBatch()
getBatch
in interface BatchableWorkSource<T>
public boolean hasMoreBatches()
hasMoreBatches
in interface BatchableWorkSource<T>
public int numberOfBatches()
numberOfBatches
in interface BatchableWorkSource<T>
public void reset(int total)
BatchableWorkSource
reset
in interface BatchableWorkSource<T>
public int getTotalSize()
getTotalSize
in interface BatchableWorkSource<T>
Copyright © 2003–2018 Atlassian. All rights reserved.