Class CompanyDraftBuilder

java.lang.Object
com.commercetools.api.models.business_unit.CompanyDraftBuilder
All Implemented Interfaces:
Builder<CompanyDraft>

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

     CompanyDraft companyDraft = CompanyDraft.builder()
             .key("{key}")
             .name("{name}")
             .build()
 
  • Constructor Details

    • CompanyDraftBuilder

      public CompanyDraftBuilder()
  • Method Details

    • key

      public CompanyDraftBuilder key(String key)

      User-defined unique identifier for the Business Unit.

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

      Indicates whether the Business Unit can be edited and used in Orders.

      Parameters:
      status - value to be set
      Returns:
      Builder
    • stores

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

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

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Parameters:
      stores - value to be set
      Returns:
      Builder
    • plusStores

      public CompanyDraftBuilder plusStores(@Nullable StoreResourceIdentifier... stores)

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Parameters:
      stores - value to be set
      Returns:
      Builder
    • plusStores

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

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

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

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

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

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

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

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

      public CompanyDraftBuilder storeMode(@Nullable BusinessUnitStoreMode storeMode)

      Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent. storeMode is always Explicit for Companies and defaults to FromParent for Divisions.

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

      public CompanyDraftBuilder name(String name)

      Name of the Business Unit.

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

      public CompanyDraftBuilder contactEmail(@Nullable String contactEmail)

      Email address of the Business Unit.

      Parameters:
      contactEmail - value to be set
      Returns:
      Builder
    • associateMode

      public CompanyDraftBuilder associateMode(@Nullable BusinessUnitAssociateMode associateMode)

      Determines whether the Business Unit can inherit Associates from a parent. Always Explicit for Companies and defaults to ExplicitAndFromParent for Divisions.

      Parameters:
      associateMode - value to be set
      Returns:
      Builder
    • associates

      public CompanyDraftBuilder associates(@Nullable AssociateDraft... associates)

      List of members that are part of the Business Unit in specific roles.

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

      public CompanyDraftBuilder associates(@Nullable List<AssociateDraft> associates)

      List of members that are part of the Business Unit in specific roles.

      Parameters:
      associates - value to be set
      Returns:
      Builder
    • plusAssociates

      public CompanyDraftBuilder plusAssociates(@Nullable AssociateDraft... associates)

      List of members that are part of the Business Unit in specific roles.

      Parameters:
      associates - value to be set
      Returns:
      Builder
    • plusAssociates

      List of members that are part of the Business Unit in specific roles.

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

      List of members that are part of the Business Unit in specific roles.

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

      List of members that are part of the Business Unit in specific roles.

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

      List of members that are part of the Business Unit in specific roles.

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

      public CompanyDraftBuilder addresses(@Nullable BaseAddress... addresses)

      Addresses used by the Business Unit.

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

      public CompanyDraftBuilder addresses(@Nullable List<BaseAddress> addresses)

      Addresses used by the Business Unit.

      Parameters:
      addresses - value to be set
      Returns:
      Builder
    • plusAddresses

      public CompanyDraftBuilder plusAddresses(@Nullable BaseAddress... addresses)

      Addresses used by the Business Unit.

      Parameters:
      addresses - value to be set
      Returns:
      Builder
    • plusAddresses

      Addresses used by the Business Unit.

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

      Addresses used by the Business Unit.

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

      Addresses used by the Business Unit.

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

      Addresses used by the Business Unit.

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

      public CompanyDraftBuilder shippingAddresses(@Nullable Integer... shippingAddresses)

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

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

      public CompanyDraftBuilder shippingAddresses(@Nullable List<Integer> shippingAddresses)

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Parameters:
      shippingAddresses - value to be set
      Returns:
      Builder
    • plusShippingAddresses

      public CompanyDraftBuilder plusShippingAddresses(@Nullable Integer... shippingAddresses)

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Parameters:
      shippingAddresses - value to be set
      Returns:
      Builder
    • defaultShippingAddress

      public CompanyDraftBuilder defaultShippingAddress(@Nullable Integer defaultShippingAddress)

      Index of the entry in addresses to set as the default shipping address.

      Parameters:
      defaultShippingAddress - value to be set
      Returns:
      Builder
    • billingAddresses

      public CompanyDraftBuilder billingAddresses(@Nullable Integer... billingAddresses)

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

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

      public CompanyDraftBuilder billingAddresses(@Nullable List<Integer> billingAddresses)

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Parameters:
      billingAddresses - value to be set
      Returns:
      Builder
    • plusBillingAddresses

      public CompanyDraftBuilder plusBillingAddresses(@Nullable Integer... billingAddresses)

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Parameters:
      billingAddresses - value to be set
      Returns:
      Builder
    • defaultBillingAddress

      public CompanyDraftBuilder defaultBillingAddress(@Nullable Integer defaultBillingAddress)

      Index of the entry in addresses to set as the default billing address.

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

      Custom Fields for the Business Unit.

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

      Custom Fields for the Business Unit.

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

      Custom Fields for the Business Unit.

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

      public String getKey()

      User-defined unique identifier for the Business Unit.

      Returns:
      key
    • getStatus

      @Nullable public BusinessUnitStatus getStatus()

      Indicates whether the Business Unit can be edited and used in Orders.

      Returns:
      status
    • getStores

      @Nullable public List<StoreResourceIdentifier> getStores()

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Returns:
      stores
    • getStoreMode

      @Nullable public BusinessUnitStoreMode getStoreMode()

      Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent. storeMode is always Explicit for Companies and defaults to FromParent for Divisions.

      Returns:
      storeMode
    • getName

      public String getName()

      Name of the Business Unit.

      Returns:
      name
    • getContactEmail

      @Nullable public String getContactEmail()

      Email address of the Business Unit.

      Returns:
      contactEmail
    • getAssociateMode

      @Nullable public BusinessUnitAssociateMode getAssociateMode()

      Determines whether the Business Unit can inherit Associates from a parent. Always Explicit for Companies and defaults to ExplicitAndFromParent for Divisions.

      Returns:
      associateMode
    • getAssociates

      @Nullable public List<AssociateDraft> getAssociates()

      List of members that are part of the Business Unit in specific roles.

      Returns:
      associates
    • getAddresses

      @Nullable public List<BaseAddress> getAddresses()

      Addresses used by the Business Unit.

      Returns:
      addresses
    • getShippingAddresses

      @Nullable public List<Integer> getShippingAddresses()

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Returns:
      shippingAddresses
    • getDefaultShippingAddress

      @Nullable public Integer getDefaultShippingAddress()

      Index of the entry in addresses to set as the default shipping address.

      Returns:
      defaultShippingAddress
    • getBillingAddresses

      @Nullable public List<Integer> getBillingAddresses()

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Returns:
      billingAddresses
    • getDefaultBillingAddress

      @Nullable public Integer getDefaultBillingAddress()

      Index of the entry in addresses to set as the default billing address.

      Returns:
      defaultBillingAddress
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Business Unit.

      Returns:
      custom
    • build

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

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

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

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