Package com.commercetools.sync.products
Class ProductSyncOptionsBuilder
- java.lang.Object
-
- com.commercetools.sync.commons.BaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.ProductProjection,io.sphere.sdk.products.ProductDraft,io.sphere.sdk.products.Product>
-
- com.commercetools.sync.products.ProductSyncOptionsBuilder
-
public final class ProductSyncOptionsBuilder extends BaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.ProductProjection,io.sphere.sdk.products.ProductDraft,io.sphere.sdk.products.Product>
-
-
Field Summary
Fields Modifier and Type Field Description static intBATCH_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 ProductSyncOptionsbuild()Creates new instance ofSwhich extendsBaseSyncOptionsenriched with all attributes provided tothisbuilder.ProductSyncOptionsBuilderensurePriceChannels(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 ProductSyncOptionsBuildergetThis()static ProductSyncOptionsBuilderof(io.sphere.sdk.client.SphereClient ctpClient)ProductSyncOptionsBuildersyncFilter(SyncFilter syncFilter)Set option that definesSyncFilterfor 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 definesSyncFilterfor 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:
thisinstance 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_DEFAULTby 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:
thisinstance ofProductSyncOptionsBuilder
-
build
@Nonnull public ProductSyncOptions build()
Description copied from class:BaseSyncOptionsBuilderCreates new instance ofSwhich extendsBaseSyncOptionsenriched with all attributes provided tothisbuilder.- Specified by:
buildin classBaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.ProductProjection,io.sphere.sdk.products.ProductDraft,io.sphere.sdk.products.Product>- Returns:
- new instance of S which extends
BaseSyncOptions
-
getThis
protected ProductSyncOptionsBuilder getThis()
Description copied from class:BaseSyncOptionsBuilderReturnsthisinstance ofT, which extendsBaseSyncOptionsBuilder. The purpose of this method is to make sure thatthisis an instance of a class which extendsBaseSyncOptionsBuilderin order to be used in the generic methods of the class. Otherwise, without this method, the methods above would need to castthis to Twhich could lead to a runtime error of the class was extended in a wrong way.- Specified by:
getThisin classBaseSyncOptionsBuilder<ProductSyncOptionsBuilder,ProductSyncOptions,io.sphere.sdk.products.ProductProjection,io.sphere.sdk.products.ProductDraft,io.sphere.sdk.products.Product>- Returns:
- an instance of the class that overrides this method.
-
-