Class StoreBuilder

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

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

     Store store = Store.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .key("{key}")
             .plusLanguages(languagesBuilder -> languagesBuilder)
             .plusCountries(countriesBuilder -> countriesBuilder)
             .plusDistributionChannels(distributionChannelsBuilder -> distributionChannelsBuilder)
             .plusSupplyChannels(supplyChannelsBuilder -> supplyChannelsBuilder)
             .plusProductSelections(productSelectionsBuilder -> productSelectionsBuilder)
             .build()
 
  • Constructor Details

    • StoreBuilder

      public StoreBuilder()
  • Method Details

    • id

      public StoreBuilder id(String id)

      Unique ID of the Store.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public StoreBuilder version(Long version)

      Current version of the Store.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public StoreBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Store was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public StoreBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Store was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the Store.

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

      public StoreBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the Store.

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

      public StoreBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Store.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the Store.

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

      public StoreBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the Store.

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

      public StoreBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the Store.

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

      public StoreBuilder key(String key)

      User-defined unique and immutable identifier for the Store.

      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 StoreBuilder languages(String... languages)

      Languages configured for the Store.

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

      public StoreBuilder languages(List<String> languages)

      Languages configured for the Store.

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

      public StoreBuilder plusLanguages(String... languages)

      Languages configured for the Store.

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

      public StoreBuilder countries(StoreCountry... countries)

      Countries defined for the Store.

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

      public StoreBuilder countries(List<StoreCountry> countries)

      Countries defined for the Store.

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

      public StoreBuilder plusCountries(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

      public StoreBuilder addCountries(Function<StoreCountryBuilder,StoreCountry> builder)

      Countries defined for the Store.

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

      public StoreBuilder setCountries(Function<StoreCountryBuilder,StoreCountry> builder)

      Countries defined for the Store.

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

      public StoreBuilder distributionChannels(ChannelReference... distributionChannels)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder distributionChannels(List<ChannelReference> distributionChannels)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder plusDistributionChannels(ChannelReference... distributionChannels)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder plusDistributionChannels(Function<ChannelReferenceBuilder,ChannelReferenceBuilder> builder)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder withDistributionChannels(Function<ChannelReferenceBuilder,ChannelReferenceBuilder> builder)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder addDistributionChannels(Function<ChannelReferenceBuilder,ChannelReference> builder)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder setDistributionChannels(Function<ChannelReferenceBuilder,ChannelReference> builder)

      Product Distribution Channels allowed for the Store.

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

      public StoreBuilder supplyChannels(ChannelReference... supplyChannels)

      Inventory Supply Channels allowed for the Store.

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

      public StoreBuilder supplyChannels(List<ChannelReference> supplyChannels)

      Inventory Supply Channels allowed for the Store.

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

      public StoreBuilder plusSupplyChannels(ChannelReference... supplyChannels)

      Inventory Supply Channels allowed for the Store.

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

      Inventory Supply Channels allowed for the Store.

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

      Inventory Supply Channels allowed for the Store.

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

      public StoreBuilder addSupplyChannels(Function<ChannelReferenceBuilder,ChannelReference> builder)

      Inventory Supply Channels allowed for the Store.

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

      public StoreBuilder setSupplyChannels(Function<ChannelReferenceBuilder,ChannelReference> builder)

      Inventory Supply Channels allowed for the Store.

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

      public StoreBuilder productSelections(ProductSelectionSetting... productSelections)

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • productSelections

      public StoreBuilder productSelections(List<ProductSelectionSetting> productSelections)

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • plusProductSelections

      public StoreBuilder plusProductSelections(ProductSelectionSetting... productSelections)

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      productSelections - value to be set
      Returns:
      Builder
    • plusProductSelections

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • withProductSelections

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • addProductSelections

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Parameters:
      builder - function to build the productSelections value
      Returns:
      Builder
    • setProductSelections

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability 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

      public StoreBuilder withCustom(Function<CustomFieldsBuilder,CustomFields> builder)

      Custom fields for the Store.

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

      public StoreBuilder custom(@Nullable CustomFields custom)

      Custom fields for the Store.

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

      public String getId()

      Unique ID of the Store.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Store.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Store was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Store was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Store.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the Store.

      Returns:
      createdBy
    • getKey

      public String getKey()

      User-defined unique and immutable identifier for the Store.

      Returns:
      key
    • getName

      @Nullable public LocalizedString getName()

      Name of the Store.

      Returns:
      name
    • getLanguages

      public List<String> getLanguages()

      Languages configured for the Store.

      Returns:
      languages
    • getCountries

      public List<StoreCountry> getCountries()

      Countries defined for the Store.

      Returns:
      countries
    • getDistributionChannels

      public List<ChannelReference> getDistributionChannels()

      Product Distribution Channels allowed for the Store.

      Returns:
      distributionChannels
    • getSupplyChannels

      public List<ChannelReference> getSupplyChannels()

      Inventory Supply Channels allowed for the Store.

      Returns:
      supplyChannels
    • getProductSelections

      public List<ProductSelectionSetting> getProductSelections()

      Controls availability of Products for this Store via 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 availlable 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 availlable in this Store.
      • If at least an active Product Selection is provided, only active Product Selections are considered to compute the availlability in this Store.
      Returns:
      productSelections
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom fields for the Store.

      Returns:
      custom
    • build

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

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

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

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