public class DatabaseUpgradePaginatorImpl extends Object implements DatabaseUpgradePaginator
DatabaseUpgradePaginator.PaginatedDataSupplier<T>
Constructor and Description |
---|
DatabaseUpgradePaginatorImpl(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate) |
Modifier and Type | Method and Description |
---|---|
<T> void |
forEach(DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier,
Consumer<T> consumer)
Executes the given
consumer for each element of an underlying large collection of elements. |
<T> void |
forEach(DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier,
int pageSize,
Consumer<T> consumer)
Executes the given
consumer for each element of an underlying large collection of elements. |
<T> void |
forEachPage(DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier,
Consumer<Collection<T>> elementConsumer)
Executes the given
consumer on each page of an underlying large collection of elements. |
<T> void |
forEachPage(DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier,
int pageSize,
Consumer<Collection<T>> elementConsumer)
Executes the given
consumer for each page of an underlying large collection of elements. |
@Autowired public DatabaseUpgradePaginatorImpl(BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate)
public <T> void forEachPage(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<Collection<T>> elementConsumer)
DatabaseUpgradePaginator
consumer
on each page of an underlying large collection of elements. The elements
are fetched using the dataSupplier
page by page, with default pageSize
.forEachPage
in interface DatabaseUpgradePaginator
T
- type of elements iterated overdataSupplier
- a supplier for fetching paginated data from the actual data sourceelementConsumer
- action to perform for each page; every call will be wrapped in a separate transactionpublic <T> void forEachPage(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<Collection<T>> elementConsumer)
DatabaseUpgradePaginator
consumer
for each page of an underlying large collection of elements. The elements
are fetched using the dataSupplier
page by page, with specified pageSize
.forEachPage
in interface DatabaseUpgradePaginator
T
- type of elements iterated overdataSupplier
- a supplier for fetching paginated data from the actual data sourcepageSize
- size of each fetched pageelementConsumer
- action to perform for each page; every call will be wrapped in a separate transactionpublic <T> void forEach(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, @NotNull Consumer<T> consumer)
DatabaseUpgradePaginator
consumer
for each element of an underlying large collection of elements. The elements
are fetched using the dataSupplier
page by page, with default pageSize
.forEach
in interface DatabaseUpgradePaginator
T
- type of elements iterated overdataSupplier
- a supplier for fetching paginated data from the actual data sourceconsumer
- action to perform for each element; executed in transactions, one transaction per pagepublic <T> void forEach(@NotNull DatabaseUpgradePaginator.PaginatedDataSupplier<T> dataSupplier, int pageSize, @NotNull Consumer<T> consumer)
DatabaseUpgradePaginator
consumer
for each element of an underlying large collection of elements. The elements
are fetched using the dataSupplier
page by page, with specified pageSize
.forEach
in interface DatabaseUpgradePaginator
T
- type of elements iterated overdataSupplier
- a supplier for fetching paginated data from the actual data sourcepageSize
- size of each fetched pageconsumer
- action to perform for each element; executed in transactions, one transaction per pageCopyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.