Package com.commercetools.sync.products
Class ProductSyncOptionsBuilder
- java.lang.Object
-
- com.commercetools.sync.commons.BaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
-
- com.commercetools.sync.products.ProductSyncOptionsBuilder
-
public final class ProductSyncOptionsBuilder extends BaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
-
-
Field Summary
Fields Modifier and Type Field Description static int
BATCH_SIZE_DEFAULT
-
Fields inherited from class com.commercetools.sync.commons.BaseSyncOptionsBuilder
batchSize, beforeCreateCallback, beforeUpdateCallback, cacheSize, ctpClient, errorCallback, warningCallback
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductSyncOptions
build()
Creates new instance ofS
which extendsBaseSyncOptions
enriched with all attributes provided tothis
builder.ProductSyncOptionsBuilder
ensurePriceChannels(boolean ensurePriceChannels)
Set option that indicates whether sync process should create a price channel of given key when it doesn't exist in a target project yet.protected ProductSyncOptionsBuilder
getThis()
static ProductSyncOptionsBuilder
of(io.sphere.sdk.client.SphereClient ctpClient)
ProductSyncOptionsBuilder
syncFilter(SyncFilter syncFilter)
Set option that definesSyncFilter
for the sync, which defines either a blacklist or a whitelist for filtering certain update action groups.-
Methods inherited from class com.commercetools.sync.commons.BaseSyncOptionsBuilder
batchSize, beforeCreateCallback, beforeUpdateCallback, cacheSize, errorCallback, warningCallback
-
-
-
-
Field Detail
-
BATCH_SIZE_DEFAULT
public static final int BATCH_SIZE_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static ProductSyncOptionsBuilder of(@Nonnull io.sphere.sdk.client.SphereClient ctpClient)
-
syncFilter
@Nonnull public ProductSyncOptionsBuilder syncFilter(@Nonnull SyncFilter syncFilter)
Set option that definesSyncFilter
for the sync, which defines either a blacklist or a whitelist for filtering certain update action groups.The action groups can be a list of any of the values of the enum
ActionGroup
, namely:- ATTRIBUTES
- PRICES
- IMAGES
- CATEGORIES
- .. and others
- Parameters:
syncFilter
- defines either a blacklist or a whitelist for filtering certain update action groups.- Returns:
this
instance ofProductSyncOptionsBuilder
-
ensurePriceChannels
@Nonnull public ProductSyncOptionsBuilder ensurePriceChannels(boolean ensurePriceChannels)
Set option that indicates whether sync process should create a price channel of given key when it doesn't exist in a target project yet. If set totrue
, the sync process would try to create the new price channel of the given key, otherwise the sync process would log an error and fail to process the draft with the given price channel key.This property is
ENSURE_CHANNELS_DEFAULT
by default.- Parameters:
ensurePriceChannels
- boolean that indicates whether sync process should create price channel of given key when it doesn't exist in a target project yet- Returns:
this
instance ofProductSyncOptionsBuilder
-
build
@Nonnull public ProductSyncOptions build()
Description copied from class:BaseSyncOptionsBuilder
Creates new instance ofS
which extendsBaseSyncOptions
enriched with all attributes provided tothis
builder.- Specified by:
build
in classBaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
- Returns:
- new instance of S which extends
BaseSyncOptions
-
getThis
protected ProductSyncOptionsBuilder getThis()
Description copied from class:BaseSyncOptionsBuilder
Returnsthis
instance ofT
, which extendsBaseSyncOptionsBuilder
. The purpose of this method is to make sure thatthis
is an instance of a class which extendsBaseSyncOptionsBuilder
in order to be used in the generic methods of the class. Otherwise, without this method, the methods above would need to castthis to T
which could lead to a runtime error of the class was extended in a wrong way.- Specified by:
getThis
in classBaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.Product,io.sphere.sdk.products.ProductDraft>
- Returns:
- an instance of the class that overrides this method.
-
-