public final class QueryExecutionUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PAGE_SIZE |
Modifier and Type | Method and Description |
---|---|
static <T,C extends QueryDsl<T,C>> |
queryAll(SphereClient client,
QueryDsl<T,C> query)
Queries all elements matching a query by using an offset based pagination with page size 500.
|
static <T,C extends QueryDsl<T,C>> |
queryAll(SphereClient client,
QueryDsl<T,C> query,
Consumer<T> resultsConsumer)
Queries all elements matching a query by using an offset based pagination with page size 500.
|
static <T,C extends QueryDsl<T,C>> |
queryAll(SphereClient client,
QueryDsl<T,C> query,
Consumer<T> resultsConsumer,
int pageSize)
Queries all elements matching a query by using an offset based pagination.
|
static <T,C extends QueryDsl<T,C>,S> |
queryAll(SphereClient client,
QueryDsl<T,C> query,
Function<T,S> resultsMapper)
Queries all elements matching a query by using an offset based pagination with page size 500.
|
static <T,C extends QueryDsl<T,C>,S> |
queryAll(SphereClient client,
QueryDsl<T,C> query,
Function<T,S> resultsMapper,
int pageSize)
Queries all elements matching a query by using an offset based pagination.
|
static <T,C extends QueryDsl<T,C>> |
queryAll(SphereClient client,
QueryDsl<T,C> query,
int pageSize)
Queries all elements matching a query by using an offset based pagination.
|
public static final int DEFAULT_PAGE_SIZE
public static <T,C extends QueryDsl<T,C>> CompletionStage<List<T>> queryAll(SphereClient client, QueryDsl<T,C> query)
T
- type of one query result elementC
- type of the queryclient
- commercetools Composable Commerce clientquery
- query containing predicates and expansion pathspublic static <T,C extends QueryDsl<T,C>> CompletionStage<List<T>> queryAll(SphereClient client, QueryDsl<T,C> query, int pageSize)
T
- type of one query result elementC
- type of the queryclient
- commercetools Composable Commerce clientquery
- query containing predicates and expansion pathspageSize
- size of one batch to fetch@Nonnull public static <T,C extends QueryDsl<T,C>,S> CompletionStage<List<S>> queryAll(@Nonnull SphereClient client, @Nonnull QueryDsl<T,C> query, @Nonnull Function<T,S> resultsMapper)
Function
that returns a result of type <S>
that is returned on every
page of elements queried. Eventually, the method returns a CompletionStage
that contains a list of all
the results of the callbacks returned from every page.T
- type of one query result elementC
- type of the queryS
- type of the returned result of the callback function on every page.client
- commercetools Composable Commerce clientquery
- query containing predicates and expansion pathsresultsMapper
- callback function that is called on every page queried.@Nonnull public static <T,C extends QueryDsl<T,C>,S> CompletionStage<List<S>> queryAll(@Nonnull SphereClient client, @Nonnull QueryDsl<T,C> query, @Nonnull Function<T,S> resultsMapper, int pageSize)
Function
that returns a result of type <S>
that is returned on every page of elements queried.
Eventually, the method returns a CompletionStage
that contains a list of all the results of the
callbacks returned from every page.T
- type of one query result elementC
- type of the queryS
- type of the returned result of the callback function on every page.client
- commercetools Composable Commerce clientquery
- query containing predicates and expansion pathsresultsMapper
- callback function that is called on every page queried.pageSize
- the page size.@Nonnull public static <T,C extends QueryDsl<T,C>> CompletionStage<Void> queryAll(@Nonnull SphereClient client, @Nonnull QueryDsl<T,C> query, @Nonnull Consumer<T> resultsConsumer)
Consumer
that is applied on on every page of elements queried.T
- type of one query result elementC
- type of the queryclient
- commercetools clientquery
- query containing predicates and expansion pathsresultsConsumer
- that is applied on every page queried.@Nonnull public static <T,C extends QueryDsl<T,C>> CompletionStage<Void> queryAll(@Nonnull SphereClient client, @Nonnull QueryDsl<T,C> query, @Nonnull Consumer<T> resultsConsumer, int pageSize)
Consumer
that is applied on on every page of elements queried.T
- type of one query result elementC
- type of the queryclient
- commercetools Composable Commerce clientquery
- query containing predicates and expansion pathsresultsConsumer
- that is applied on every page queried.pageSize
- the page size.