Class StoreDraftBuilder

java.lang.Object
com.commercetools.api.models.store.StoreDraftBuilder
All Implemented Interfaces:
Builder<StoreDraft>

public class StoreDraftBuilder extends Object implements Builder<StoreDraft>
StoreDraftBuilder
Example to create an instance using the builder pattern

     StoreDraft storeDraft = StoreDraft.builder()
             .key("{key}")
             .build()
 
  • Constructor Details

    • StoreDraftBuilder

      public StoreDraftBuilder()
  • Method Details

    • key

      public StoreDraftBuilder key(String key)

      User-defined unique and immutable identifier for the Store. Keys can only contain alphanumeric characters, underscores, and hyphens.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • name

      Name of the Store.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • withName

      Name of the Store.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • name

      Name of the Store.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • languages

      public StoreDraftBuilder languages(@Nullable String... languages)

      Languages defined in Project. Only languages defined in the Project can be used.

      Parameters:
      languages - value to be set
      Returns:
      Builder
    • languages

      public StoreDraftBuilder languages(@Nullable List<String> languages)

      Languages defined in Project. Only languages defined in the Project can be used.

      Parameters:
      languages - value to be set
      Returns:
      Builder
    • plusLanguages

      public StoreDraftBuilder plusLanguages(@Nullable String... languages)

      Languages defined in Project. Only languages defined in the Project can be used.

      Parameters:
      languages - value to be set
      Returns:
      Builder
    • countries

      public StoreDraftBuilder countries(@Nullable StoreCountry... countries)

      Countries defined for the Store.

      Parameters:
      countries - value to be set
      Returns:
      Builder
    • countries

      public StoreDraftBuilder countries(@Nullable List<StoreCountry> countries)

      Countries defined for the Store.

      Parameters:
      countries - value to be set
      Returns:
      Builder
    • plusCountries

      public StoreDraftBuilder plusCountries(@Nullable StoreCountry... countries)

      Countries defined for the Store.

      Parameters:
      countries - value to be set
      Returns:
      Builder
    • plusCountries

      Countries defined for the Store.

      Parameters:
      builder - function to build the countries value
      Returns:
      Builder
    • withCountries

      Countries defined for the Store.

      Parameters:
      builder - function to build the countries value
      Returns:
      Builder
    • addCountries

      Countries defined for the Store.

      Parameters:
      builder - function to build the countries value
      Returns:
      Builder
    • setCountries

      Countries defined for the Store.

      Parameters:
      builder - function to build the countries value
      Returns:
      Builder
    • distributionChannels

      public StoreDraftBuilder distributionChannels(@Nullable ChannelResourceIdentifier... distributionChannels)

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      distributionChannels - value to be set
      Returns:
      Builder
    • distributionChannels

      public StoreDraftBuilder distributionChannels(@Nullable List<ChannelResourceIdentifier> distributionChannels)

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      distributionChannels - value to be set
      Returns:
      Builder
    • plusDistributionChannels

      public StoreDraftBuilder plusDistributionChannels(@Nullable ChannelResourceIdentifier... distributionChannels)

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      distributionChannels - value to be set
      Returns:
      Builder
    • plusDistributionChannels

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      builder - function to build the distributionChannels value
      Returns:
      Builder
    • withDistributionChannels

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      builder - function to build the distributionChannels value
      Returns:
      Builder
    • addDistributionChannels

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      builder - function to build the distributionChannels value
      Returns:
      Builder
    • setDistributionChannels

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Parameters:
      builder - function to build the distributionChannels value
      Returns:
      Builder
    • supplyChannels

      public StoreDraftBuilder supplyChannels(@Nullable ChannelResourceIdentifier... supplyChannels)

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      supplyChannels - value to be set
      Returns:
      Builder
    • supplyChannels

      public StoreDraftBuilder supplyChannels(@Nullable List<ChannelResourceIdentifier> supplyChannels)

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      supplyChannels - value to be set
      Returns:
      Builder
    • plusSupplyChannels

      public StoreDraftBuilder plusSupplyChannels(@Nullable ChannelResourceIdentifier... supplyChannels)

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      supplyChannels - value to be set
      Returns:
      Builder
    • plusSupplyChannels

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannels value
      Returns:
      Builder
    • withSupplyChannels

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannels value
      Returns:
      Builder
    • addSupplyChannels

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannels value
      Returns:
      Builder
    • setSupplyChannels

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannels value
      Returns:
      Builder
    • productSelections

      public StoreDraftBuilder productSelections(@Nullable ProductSelectionSettingDraft... productSelections)

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • productSelections

      public StoreDraftBuilder productSelections(@Nullable List<ProductSelectionSettingDraft> productSelections)

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • plusProductSelections

      public StoreDraftBuilder plusProductSelections(@Nullable ProductSelectionSettingDraft... productSelections)

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • plusProductSelections

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • withProductSelections

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • addProductSelections

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • setProductSelections

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • custom

      Custom fields for the Store.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom fields for the Store.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      Custom fields for the Store.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

      User-defined unique and immutable identifier for the Store. Keys can only contain alphanumeric characters, underscores, and hyphens.

      Returns:
      key
    • getName

      @Nullable public LocalizedString getName()

      Name of the Store.

      Returns:
      name
    • getLanguages

      @Nullable public List<String> getLanguages()

      Languages defined in Project. Only languages defined in the Project can be used.

      Returns:
      languages
    • getCountries

      @Nullable public List<StoreCountry> getCountries()

      Countries defined for the Store.

      Returns:
      countries
    • getDistributionChannels

      @Nullable public List<ChannelResourceIdentifier> getDistributionChannels()

      ResourceIdentifier of a Channel with ProductDistribution ChannelRoleEnum.

      Returns:
      distributionChannels
    • getSupplyChannels

      @Nullable public List<ChannelResourceIdentifier> getSupplyChannels()

      ResourceIdentifier of a Channel with InventorySupply ChannelRoleEnum.

      Returns:
      supplyChannels
    • getProductSelections

      @Nullable public List<ProductSelectionSettingDraft> getProductSelections()

      Controls availability of Products for this Store via active/inactive Product Selections:

      • Leave empty if all Products in the Project should be available in this Store.
      • If only inactive Product Selections with IndividualExclusion ProductSelectionMode are provided, all the Products are available in this Store.
      • If all the Product Selections provided are inactive and there's at least a Product Selection of mode Individual, no Product is available in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availability in this Store.
      Returns:
      productSelections
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom fields for the Store.

      Returns:
      custom
    • build

      public StoreDraft build()
      builds StoreDraft with checking for non-null required values
      Specified by:
      build in interface Builder<StoreDraft>
      Returns:
      StoreDraft
    • buildUnchecked

      public StoreDraft buildUnchecked()
      builds StoreDraft without checking for non-null required values
      Returns:
      StoreDraft
    • of

      public static StoreDraftBuilder of()
      factory method for an instance of StoreDraftBuilder
      Returns:
      builder
    • of

      public static StoreDraftBuilder of(StoreDraft template)
      create builder for StoreDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder