Class DivisionDraftBuilder

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

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

     DivisionDraft divisionDraft = DivisionDraft.builder()
             .key("{key}")
             .name("{name}")
             .parentUnit(parentUnitBuilder -> parentUnitBuilder)
             .build()
 
  • Constructor Details

    • DivisionDraftBuilder

      public DivisionDraftBuilder()
  • Method Details

    • key

      public DivisionDraftBuilder key(String key)

      User-defined unique and immutable 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

      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

      If not set, the Division inherits the Stores from a parent unit. Set this to Explicit if you want to set the Stores explicitly in the stores field instead.

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

      public DivisionDraftBuilder name(String name)

      Name of the Business Unit.

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

      public DivisionDraftBuilder contactEmail(@Nullable String contactEmail)

      Email address of the Business Unit.

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

      public DivisionDraftBuilder associateMode(@Nullable BusinessUnitAssociateMode associateMode)

      Determines whether the Division can inherit Associates from a parent.

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

      public DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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
    • approvalRuleMode

      public DivisionDraftBuilder approvalRuleMode(@Nullable BusinessUnitApprovalRuleMode approvalRuleMode)

      Determines whether the Division can inherit Approval Rules from a parent.

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

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

      Addresses used by the Business Unit.

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

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

      Addresses used by the Business Unit.

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

      public DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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
    • parentUnit

      The parent unit of this Division. Can be a Company or a Division.

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

      The parent unit of this Division. Can be a Company or a Division.

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

      public DivisionDraftBuilder parentUnit(BusinessUnitResourceIdentifier parentUnit)

      The parent unit of this Division. Can be a Company or a Division.

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

      public String getKey()

      User-defined unique and immutable 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()

      If not set, the Division inherits the Stores from a parent unit. Set this to Explicit if you want to set the Stores explicitly in the stores field instead.

      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 Division can inherit Associates from a parent.

      Returns:
      associateMode
    • getAssociates

      @Nullable public List<AssociateDraft> getAssociates()

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

      Returns:
      associates
    • getApprovalRuleMode

      @Nullable public BusinessUnitApprovalRuleMode getApprovalRuleMode()

      Determines whether the Division can inherit Approval Rules from a parent.

      Returns:
      approvalRuleMode
    • 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
    • getParentUnit

      public BusinessUnitResourceIdentifier getParentUnit()

      The parent unit of this Division. Can be a Company or a Division.

      Returns:
      parentUnit
    • build

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

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

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

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