Class CustomerImportBuilder

java.lang.Object
com.commercetools.importapi.models.customers.CustomerImportBuilder
All Implemented Interfaces:
Builder<CustomerImport>

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

     CustomerImport customerImport = CustomerImport.builder()
             .key("{key}")
             .email("{email}")
             .build()
 
  • Constructor Details

    • CustomerImportBuilder

      public CustomerImportBuilder()
  • Method Details

    • key

      public CustomerImportBuilder key(String key)

      User-defined unique identifier. If a Customer with this key exists, it will be updated with the imported data.

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

      public CustomerImportBuilder customerNumber(@Nullable String customerNumber)

      Maps to Customer.customerNumber.

      Parameters:
      customerNumber - value to be set
      Returns:
      Builder
    • email

      public CustomerImportBuilder email(String email)

      Maps to Customer.email.

      Parameters:
      email - value to be set
      Returns:
      Builder
    • password

      public CustomerImportBuilder password(@Nullable String password)

      Required when authenticationMode is set to Password. Maps to Customer.password.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      public CustomerImportBuilder plusStores(@Nullable StoreKeyReference... stores)

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

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

      public CustomerImportBuilder firstName(@Nullable String firstName)

      Maps to Customer.firstName.

      Parameters:
      firstName - value to be set
      Returns:
      Builder
    • lastName

      public CustomerImportBuilder lastName(@Nullable String lastName)

      Maps to Customer.lastName.

      Parameters:
      lastName - value to be set
      Returns:
      Builder
    • middleName

      public CustomerImportBuilder middleName(@Nullable String middleName)

      Maps to Customer.middleName.

      Parameters:
      middleName - value to be set
      Returns:
      Builder
    • title

      public CustomerImportBuilder title(@Nullable String title)

      Maps to Customer.title.

      Parameters:
      title - value to be set
      Returns:
      Builder
    • salutation

      public CustomerImportBuilder salutation(@Nullable String salutation)

      Maps to Customer.salutation.

      Parameters:
      salutation - value to be set
      Returns:
      Builder
    • externalId

      public CustomerImportBuilder externalId(@Nullable String externalId)

      Maps to Customer.externalId.

      Parameters:
      externalId - value to be set
      Returns:
      Builder
    • dateOfBirth

      public CustomerImportBuilder dateOfBirth(@Nullable LocalDate dateOfBirth)

      Maps to Customer.dateOfBirth.

      Parameters:
      dateOfBirth - value to be set
      Returns:
      Builder
    • companyName

      public CustomerImportBuilder companyName(@Nullable String companyName)

      Maps to Customer.companyName.

      Parameters:
      companyName - value to be set
      Returns:
      Builder
    • vatId

      public CustomerImportBuilder vatId(@Nullable String vatId)

      Maps to Customer.vatId.

      Parameters:
      vatId - value to be set
      Returns:
      Builder
    • isEmailVerified

      public CustomerImportBuilder isEmailVerified(@Nullable Boolean isEmailVerified)

      Maps to Customer.isEmailVerified.

      Parameters:
      isEmailVerified - value to be set
      Returns:
      Builder
    • customerGroup

      The Reference to the CustomerGroup with which the Customer is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      The Reference to the CustomerGroup with which the Customer is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      public CustomerImportBuilder customerGroup(@Nullable CustomerGroupKeyReference customerGroup)

      The Reference to the CustomerGroup with which the Customer is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

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

      public CustomerImportBuilder addresses(@Nullable CustomerAddress... addresses)

      Maps to Customer.addresses.

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

      public CustomerImportBuilder addresses(@Nullable List<CustomerAddress> addresses)

      Maps to Customer.addresses.

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

      public CustomerImportBuilder plusAddresses(@Nullable CustomerAddress... addresses)

      Maps to Customer.addresses.

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

      Maps to Customer.addresses.

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

      Maps to Customer.addresses.

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

      Maps to Customer.addresses.

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

      Maps to Customer.addresses.

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

      public CustomerImportBuilder defaultBillingAddress(@Nullable Integer defaultBillingAddress)

      The index of the address in the addresses array. The defaultBillingAddressId of the customer will be set to the ID of that address.

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

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

      The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

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

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

      The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

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

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

      The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

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

      public CustomerImportBuilder defaultShippingAddress(@Nullable Integer defaultShippingAddress)

      The index of the address in the addresses array. The defaultShippingAddressId of the customer will be set to the ID of that address.

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

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

      The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

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

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

      The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

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

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

      The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

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

      public CustomerImportBuilder locale(@Nullable String locale)

      Maps to Customer.locale.

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

      The Custom Fields for this Customer.

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

      public CustomerImportBuilder withCustom(Function<CustomBuilder,Custom> builder)

      The Custom Fields for this Customer.

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

      public CustomerImportBuilder custom(@Nullable Custom custom)

      The Custom Fields for this Customer.

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

      public CustomerImportBuilder authenticationMode(@Nullable AuthenticationMode authenticationMode)
      • Set to Password to make the password field required for the Customer.
      • Set to ExternalAuth when the password is not required for the Customer.
      Parameters:
      authenticationMode - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

      User-defined unique identifier. If a Customer with this key exists, it will be updated with the imported data.

      Returns:
      key
    • getCustomerNumber

      @Nullable public String getCustomerNumber()

      Maps to Customer.customerNumber.

      Returns:
      customerNumber
    • getEmail

      public String getEmail()

      Maps to Customer.email.

      Returns:
      email
    • getPassword

      @Nullable public String getPassword()

      Required when authenticationMode is set to Password. Maps to Customer.password.

      Returns:
      password
    • getStores

      @Nullable public List<StoreKeyReference> getStores()

      The References to the Stores with which the Customer is associated. If referenced Stores do not exist, the state of the ImportOperation will be set to unresolved until the necessary Stores are created.

      Returns:
      stores
    • getFirstName

      @Nullable public String getFirstName()

      Maps to Customer.firstName.

      Returns:
      firstName
    • getLastName

      @Nullable public String getLastName()

      Maps to Customer.lastName.

      Returns:
      lastName
    • getMiddleName

      @Nullable public String getMiddleName()

      Maps to Customer.middleName.

      Returns:
      middleName
    • getTitle

      @Nullable public String getTitle()

      Maps to Customer.title.

      Returns:
      title
    • getSalutation

      @Nullable public String getSalutation()

      Maps to Customer.salutation.

      Returns:
      salutation
    • getExternalId

      @Nullable public String getExternalId()

      Maps to Customer.externalId.

      Returns:
      externalId
    • getDateOfBirth

      @Nullable public LocalDate getDateOfBirth()

      Maps to Customer.dateOfBirth.

      Returns:
      dateOfBirth
    • getCompanyName

      @Nullable public String getCompanyName()

      Maps to Customer.companyName.

      Returns:
      companyName
    • getVatId

      @Nullable public String getVatId()

      Maps to Customer.vatId.

      Returns:
      vatId
    • getIsEmailVerified

      @Nullable public Boolean getIsEmailVerified()

      Maps to Customer.isEmailVerified.

      Returns:
      isEmailVerified
    • getCustomerGroup

      @Nullable public CustomerGroupKeyReference getCustomerGroup()

      The Reference to the CustomerGroup with which the Customer is associated. If referenced CustomerGroup does not exist, the state of the ImportOperation will be set to unresolved until the necessary CustomerGroup is created.

      Returns:
      customerGroup
    • getAddresses

      @Nullable public List<CustomerAddress> getAddresses()

      Maps to Customer.addresses.

      Returns:
      addresses
    • getDefaultBillingAddress

      @Nullable public Integer getDefaultBillingAddress()

      The index of the address in the addresses array. The defaultBillingAddressId of the customer will be set to the ID of that address.

      Returns:
      defaultBillingAddress
    • getBillingAddresses

      @Nullable public List<Integer> getBillingAddresses()

      The indices of the billing addresses in the addresses array. The billingAddressIds of the customer will be set to the IDs of that addresses.

      Returns:
      billingAddresses
    • getDefaultShippingAddress

      @Nullable public Integer getDefaultShippingAddress()

      The index of the address in the addresses array. The defaultShippingAddressId of the customer will be set to the ID of that address.

      Returns:
      defaultShippingAddress
    • getShippingAddresses

      @Nullable public List<Integer> getShippingAddresses()

      The indices of the shipping addresses in the addresses array. The shippingAddressIds of the customer will be set to the IDs of that addresses.

      Returns:
      shippingAddresses
    • getLocale

      @Nullable public String getLocale()

      Maps to Customer.locale.

      Returns:
      locale
    • getCustom

      @Nullable public Custom getCustom()

      The Custom Fields for this Customer.

      Returns:
      custom
    • getAuthenticationMode

      @Nullable public AuthenticationMode getAuthenticationMode()
      • Set to Password to make the password field required for the Customer.
      • Set to ExternalAuth when the password is not required for the Customer.
      Returns:
      authenticationMode
    • build

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

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

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

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