public final class CtpQueryUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>> |
queryAll(io.sphere.sdk.client.SphereClient client,
io.sphere.sdk.queries.QueryDsl<T,C> query,
java.util.function.Consumer<java.util.List<T>> pageConsumer)
Queries all elements matching a query by using a limit based pagination with a combination of id sorting and a
page size 500.
|
static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>> |
queryAll(io.sphere.sdk.client.SphereClient client,
io.sphere.sdk.queries.QueryDsl<T,C> query,
java.util.function.Consumer<java.util.List<T>> pageConsumer,
int pageSize)
Queries all elements matching a query by using a limit based pagination with a combination of id sorting and the
supplied
pageSize. |
static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>,S> |
queryAll(io.sphere.sdk.client.SphereClient client,
io.sphere.sdk.queries.QueryDsl<T,C> query,
java.util.function.Function<java.util.List<T>,S> pageMapper)
Queries all elements matching a query by using a limit based pagination with a combination of id sorting and a
page size 500.
|
static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>,S> |
queryAll(io.sphere.sdk.client.SphereClient client,
io.sphere.sdk.queries.QueryDsl<T,C> query,
java.util.function.Function<java.util.List<T>,S> pageMapper,
int pageSize)
Queries all elements matching a query by using a limit based pagination with a combination of id sorting and the
supplied
pageSize. |
@Nonnull
public static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>,S> java.util.concurrent.CompletionStage<java.util.List<S>> queryAll(@Nonnull
io.sphere.sdk.client.SphereClient client,
@Nonnull
io.sphere.sdk.queries.QueryDsl<T,C> query,
@Nonnull
java.util.function.Function<java.util.List<T>,S> pageMapper)
The method takes a callback 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.
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in parallel.
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 clientquery - query containing predicates and expansion pathspageMapper - callback function that is called on every page queried@Nonnull
public static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>> java.util.concurrent.CompletionStage<java.lang.Void> queryAll(@Nonnull
io.sphere.sdk.client.SphereClient client,
@Nonnull
io.sphere.sdk.queries.QueryDsl<T,C> query,
@Nonnull
java.util.function.Consumer<java.util.List<T>> pageConsumer)
The method takes a consumer Consumer that is applied on on every page of elements queried.
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in parallel.
T - type of one query result elementC - type of the queryclient - commercetools clientquery - query containing predicates and expansion pathspageConsumer - consumer applied on every page queried@Nonnull
public static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>,S> java.util.concurrent.CompletionStage<java.util.List<S>> queryAll(@Nonnull
io.sphere.sdk.client.SphereClient client,
@Nonnull
io.sphere.sdk.queries.QueryDsl<T,C> query,
@Nonnull
java.util.function.Function<java.util.List<T>,S> pageMapper,
int pageSize)
pageSize.
More on the algorithm can be found here: http://dev.commercetools.com/http-api.html#offset.
The method takes a callback 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.
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in parallel.
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 clientquery - query containing predicates and expansion pathspageMapper - callback function that is called on every page queriedpageSize - the page size.@Nonnull
public static <T extends io.sphere.sdk.models.Resource,C extends io.sphere.sdk.queries.QueryDsl<T,C>> java.util.concurrent.CompletionStage<java.lang.Void> queryAll(@Nonnull
io.sphere.sdk.client.SphereClient client,
@Nonnull
io.sphere.sdk.queries.QueryDsl<T,C> query,
@Nonnull
java.util.function.Consumer<java.util.List<T>> pageConsumer,
int pageSize)
pageSize.
More on the algorithm can be found here: http://dev.commercetools.com/http-api.html#offset
The method takes a consumer Consumer that is applied on on every page of elements queried.
NOTE: This method fetches all paged results sequentially as opposed to fetching the pages in parallel.
T - type of one query result elementC - type of the queryclient - commercetools clientquery - query containing predicates and expansion pathspageConsumer - consumer applied on every page queriedpageSize - the page size