Class InventorySyncOptionsBuilder
- java.lang.Object
-
- com.commercetools.sync.commons.BaseSyncOptionsBuilder<InventorySyncOptionsBuilder,InventorySyncOptions,io.sphere.sdk.inventory.InventoryEntry,io.sphere.sdk.inventory.InventoryEntryDraft,io.sphere.sdk.inventory.InventoryEntry>
-
- com.commercetools.sync.inventories.InventorySyncOptionsBuilder
-
public final class InventorySyncOptionsBuilder extends BaseSyncOptionsBuilder<InventorySyncOptionsBuilder,InventorySyncOptions,io.sphere.sdk.inventory.InventoryEntry,io.sphere.sdk.inventory.InventoryEntryDraft,io.sphere.sdk.inventory.InventoryEntry>
Builder for creation ofInventorySyncOptions
.
-
-
Field Summary
-
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 InventorySyncOptions
build()
Returns new instance ofInventorySyncOptions
, enriched with all attributes provided tothis
builder.InventorySyncOptionsBuilder
ensureChannels(boolean ensureChannels)
Set option that indicates whether sync process should create a supply channel of given key when it doesn't exist in a target project yet.protected InventorySyncOptionsBuilder
getThis()
Returnsthis
instance ofInventorySyncOptionsBuilder
.static InventorySyncOptionsBuilder
of(io.sphere.sdk.client.SphereClient ctpClient)
Creates a new instance ofInventorySyncOptionsBuilder
given aSphereClient
responsible for interaction with the target CTP project, with the default batch size (BATCH_SIZE_DEFAULT
= 150).-
Methods inherited from class com.commercetools.sync.commons.BaseSyncOptionsBuilder
batchSize, beforeCreateCallback, beforeUpdateCallback, cacheSize, errorCallback, warningCallback
-
-
-
-
Method Detail
-
of
public static InventorySyncOptionsBuilder of(@Nonnull io.sphere.sdk.client.SphereClient ctpClient)
Creates a new instance ofInventorySyncOptionsBuilder
given aSphereClient
responsible for interaction with the target CTP project, with the default batch size (BATCH_SIZE_DEFAULT
= 150).- Parameters:
ctpClient
-SphereClient
responsible for interaction with the target CTP project.- Returns:
- new instance of
InventorySyncOptionsBuilder
-
ensureChannels
public InventorySyncOptionsBuilder ensureChannels(boolean ensureChannels)
Set option that indicates whether sync process should create a supply channel of given key when it doesn't exist in a target project yet. If set totrue
sync process would try to create new supply channel of given key, otherwise the sync process would log an error and fail to process the draft with the given supply channel key.This property is
ENSURE_CHANNELS_DEFAULT
by default.- Parameters:
ensureChannels
- boolean that indicates whether sync process should create supply channel of given key when it doesn't exist in a target project yet- Returns:
this
instance ofInventorySyncOptionsBuilder
-
build
public InventorySyncOptions build()
Returns new instance ofInventorySyncOptions
, enriched with all attributes provided tothis
builder.- Specified by:
build
in classBaseSyncOptionsBuilder<InventorySyncOptionsBuilder,InventorySyncOptions,io.sphere.sdk.inventory.InventoryEntry,io.sphere.sdk.inventory.InventoryEntryDraft,io.sphere.sdk.inventory.InventoryEntry>
- Returns:
- new instance of
InventorySyncOptions
-
getThis
protected InventorySyncOptionsBuilder getThis()
Returnsthis
instance ofInventorySyncOptionsBuilder
.Inherited doc:
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<InventorySyncOptionsBuilder,InventorySyncOptions,io.sphere.sdk.inventory.InventoryEntry,io.sphere.sdk.inventory.InventoryEntryDraft,io.sphere.sdk.inventory.InventoryEntry>
- Returns:
- an instance of the class that overrides this method.
-
-