Class MyDivisionDraftBuilder

java.lang.Object
com.commercetools.api.models.me.MyDivisionDraftBuilder
All Implemented Interfaces:
Builder<MyDivisionDraft>

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

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

    • MyDivisionDraftBuilder

      public MyDivisionDraftBuilder()
  • Method Details

    • key

      public MyDivisionDraftBuilder key(String key)

      User-defined unique identifier for the BusinessUnit.

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

      public MyDivisionDraftBuilder name(String name)

      Name of the Business Unit.

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

      public MyDivisionDraftBuilder contactEmail(@Nullable String contactEmail)

      Email address of the Business Unit.

      Parameters:
      contactEmail - 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
    • addresses

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

      Addresses used by the Business Unit.

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

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

      Addresses used by the Business Unit.

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

      public MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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 MyDivisionDraftBuilder 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
    • 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

      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 identifier for the BusinessUnit.

      Returns:
      key
    • getName

      public String getName()

      Name of the Business Unit.

      Returns:
      name
    • getContactEmail

      @Nullable public String getContactEmail()

      Email address of the Business Unit.

      Returns:
      contactEmail
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Business Unit.

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

      public BusinessUnitResourceIdentifier getParentUnit()

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

      Returns:
      parentUnit
    • build

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

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

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

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