Class CustomerDraftImpl

java.lang.Object
com.commercetools.api.models.customer.CustomerDraftImpl
All Implemented Interfaces:
CustomerDraft, CustomizableDraft<CustomerDraft>, WithKey, io.vrap.rmf.base.client.Draft<CustomerDraft>, io.vrap.rmf.base.client.ModelBase

public class CustomerDraftImpl extends Object implements CustomerDraft, io.vrap.rmf.base.client.ModelBase
CustomerDraft
  • Constructor Details

    • CustomerDraftImpl

      public CustomerDraftImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

      User-defined unique identifier for the Customer. The key field is preferred over customerNumber as it is mutable and provides more flexibility.

      Specified by:
      getKey in interface CustomerDraft
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getCustomerNumber

      public String getCustomerNumber()

      User-defined unique identifier for a Customer. Once set, it cannot be changed.

      Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

      Specified by:
      getCustomerNumber in interface CustomerDraft
      Returns:
      customerNumber
    • getExternalId

      public String getExternalId()

      Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

      Specified by:
      getExternalId in interface CustomerDraft
      Returns:
      externalId
    • getEmail

      public String getEmail()

      Email address of the Customer that must be unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.

      Specified by:
      getEmail in interface CustomerDraft
      Returns:
      email
    • getPassword

      public String getPassword()

      Required when authenticationMode is set to Password. Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

      Specified by:
      getPassword in interface CustomerDraft
      Returns:
      password
    • getFirstName

      public String getFirstName()

      Given name (first name) of the Customer.

      Specified by:
      getFirstName in interface CustomerDraft
      Returns:
      firstName
    • getLastName

      public String getLastName()

      Family name (last name) of the Customer.

      Specified by:
      getLastName in interface CustomerDraft
      Returns:
      lastName
    • getMiddleName

      public String getMiddleName()

      Middle name of the Customer.

      Specified by:
      getMiddleName in interface CustomerDraft
      Returns:
      middleName
    • getTitle

      public String getTitle()

      Title of the Customer, for example, 'Dr.'.

      Specified by:
      getTitle in interface CustomerDraft
      Returns:
      title
    • getAnonymousCartId

      @Deprecated public String getAnonymousCartId()
      Deprecated.

      Deprecated since an anonymous Cart can be identified by its id or external key.

      Specified by:
      getAnonymousCartId in interface CustomerDraft
      Returns:
      anonymousCartId
    • getAnonymousCart

      public CartResourceIdentifier getAnonymousCart()

      Identifies a Cart that will be assigned to the new Customer.

      Specified by:
      getAnonymousCart in interface CustomerDraft
      Returns:
      anonymousCart
    • getAnonymousId

      public String getAnonymousId()

      Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

      Specified by:
      getAnonymousId in interface CustomerDraft
      Returns:
      anonymousId
    • getDateOfBirth

      public LocalDate getDateOfBirth()

      Date of birth of the Customer.

      Specified by:
      getDateOfBirth in interface CustomerDraft
      Returns:
      dateOfBirth
    • getCompanyName

      public String getCompanyName()

      Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

      Specified by:
      getCompanyName in interface CustomerDraft
      Returns:
      companyName
    • getVatId

      public String getVatId()

      Individual VAT ID of the Customer.

      Specified by:
      getVatId in interface CustomerDraft
      Returns:
      vatId
    • getAddresses

      public List<BaseAddress> getAddresses()

      Addresses of the Customer.

      Specified by:
      getAddresses in interface CustomerDraft
      Returns:
      addresses
    • getDefaultShippingAddress

      public Integer getDefaultShippingAddress()

      Index of the address in the addresses array to use as the default shipping address. The defaultShippingAddressId of the Customer will be set to the id of that address.

      Specified by:
      getDefaultShippingAddress in interface CustomerDraft
      Returns:
      defaultShippingAddress
    • getShippingAddresses

      public List<Integer> getShippingAddresses()

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      getShippingAddresses in interface CustomerDraft
      Returns:
      shippingAddresses
    • getDefaultBillingAddress

      public Integer getDefaultBillingAddress()

      Index of the address in the addresses array to use as the default billing address. The defaultBillingAddressId of the Customer will be set to the id of that address.

      Specified by:
      getDefaultBillingAddress in interface CustomerDraft
      Returns:
      defaultBillingAddress
    • getBillingAddresses

      public List<Integer> getBillingAddresses()

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      getBillingAddresses in interface CustomerDraft
      Returns:
      billingAddresses
    • getIsEmailVerified

      public Boolean getIsEmailVerified()

      Set to true if the email address of the Customer has been verified already. The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.

      Specified by:
      getIsEmailVerified in interface CustomerDraft
      Returns:
      isEmailVerified
    • getCustomerGroup

      public CustomerGroupResourceIdentifier getCustomerGroup()

      Sets the CustomerGroup for the Customer.

      Specified by:
      getCustomerGroup in interface CustomerDraft
      Returns:
      customerGroup
    • getCustom

      public CustomFieldsDraft getCustom()

      Custom Fields for the Customer.

      Specified by:
      getCustom in interface CustomerDraft
      Specified by:
      getCustom in interface CustomizableDraft<CustomerDraft>
      Returns:
      custom
    • getLocale

      public String getLocale()

      Preferred language of the Customer. Must be one of the languages supported by the Project.

      Specified by:
      getLocale in interface CustomerDraft
      Returns:
      locale
    • getSalutation

      public String getSalutation()

      Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

      Specified by:
      getSalutation in interface CustomerDraft
      Returns:
      salutation
    • getStores

      public List<StoreResourceIdentifier> getStores()

      Sets the Stores for the Customer.

      • If no Stores are specified, the Customer is a global customer, and can log in using the Password Flow for global Customers.
      • If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
      Specified by:
      getStores in interface CustomerDraft
      Returns:
      stores
    • getAuthenticationMode

      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.
      Specified by:
      getAuthenticationMode in interface CustomerDraft
      Returns:
      authenticationMode
    • setKey

      public void setKey(String key)
      Description copied from interface: CustomerDraft

      User-defined unique identifier for the Customer. The key field is preferred over customerNumber as it is mutable and provides more flexibility.

      Specified by:
      setKey in interface CustomerDraft
      Parameters:
      key - value to be set
    • setCustomerNumber

      public void setCustomerNumber(String customerNumber)
      Description copied from interface: CustomerDraft

      User-defined unique identifier for a Customer. Once set, it cannot be changed.

      Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).

      Specified by:
      setCustomerNumber in interface CustomerDraft
      Parameters:
      customerNumber - value to be set
    • setExternalId

      public void setExternalId(String externalId)
      Description copied from interface: CustomerDraft

      Optional identifier for use in external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

      Specified by:
      setExternalId in interface CustomerDraft
      Parameters:
      externalId - value to be set
    • setEmail

      public void setEmail(String email)
      Description copied from interface: CustomerDraft

      Email address of the Customer that must be unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.

      Specified by:
      setEmail in interface CustomerDraft
      Parameters:
      email - value to be set
    • setPassword

      public void setPassword(String password)
      Description copied from interface: CustomerDraft

      Required when authenticationMode is set to Password. Provide the Customer's password in plain text. The API stores passwords in an encrypted format.

      Specified by:
      setPassword in interface CustomerDraft
      Parameters:
      password - value to be set
    • setFirstName

      public void setFirstName(String firstName)
      Description copied from interface: CustomerDraft

      Given name (first name) of the Customer.

      Specified by:
      setFirstName in interface CustomerDraft
      Parameters:
      firstName - value to be set
    • setLastName

      public void setLastName(String lastName)
      Description copied from interface: CustomerDraft

      Family name (last name) of the Customer.

      Specified by:
      setLastName in interface CustomerDraft
      Parameters:
      lastName - value to be set
    • setMiddleName

      public void setMiddleName(String middleName)
      Description copied from interface: CustomerDraft

      Middle name of the Customer.

      Specified by:
      setMiddleName in interface CustomerDraft
      Parameters:
      middleName - value to be set
    • setTitle

      public void setTitle(String title)
      Description copied from interface: CustomerDraft

      Title of the Customer, for example, 'Dr.'.

      Specified by:
      setTitle in interface CustomerDraft
      Parameters:
      title - value to be set
    • setAnonymousCartId

      @Deprecated public void setAnonymousCartId(String anonymousCartId)
      Deprecated.
      Description copied from interface: CustomerDraft

      Deprecated since an anonymous Cart can be identified by its id or external key.

      Specified by:
      setAnonymousCartId in interface CustomerDraft
      Parameters:
      anonymousCartId - value to be set
    • setAnonymousCart

      public void setAnonymousCart(CartResourceIdentifier anonymousCart)
      Description copied from interface: CustomerDraft

      Identifies a Cart that will be assigned to the new Customer.

      Specified by:
      setAnonymousCart in interface CustomerDraft
      Parameters:
      anonymousCart - value to be set
    • setAnonymousId

      public void setAnonymousId(String anonymousId)
      Description copied from interface: CustomerDraft

      Identifies Carts and Orders belonging to an anonymous session that will be assigned to the new Customer.

      Specified by:
      setAnonymousId in interface CustomerDraft
      Parameters:
      anonymousId - value to be set
    • setDateOfBirth

      public void setDateOfBirth(LocalDate dateOfBirth)
      Description copied from interface: CustomerDraft

      Date of birth of the Customer.

      Specified by:
      setDateOfBirth in interface CustomerDraft
      Parameters:
      dateOfBirth - value to be set
    • setCompanyName

      public void setCompanyName(String companyName)
      Description copied from interface: CustomerDraft

      Company name of the Customer. When representing a company as a Customer, Business Units provide extended funtionality.

      Specified by:
      setCompanyName in interface CustomerDraft
      Parameters:
      companyName - value to be set
    • setVatId

      public void setVatId(String vatId)
      Description copied from interface: CustomerDraft

      Individual VAT ID of the Customer.

      Specified by:
      setVatId in interface CustomerDraft
      Parameters:
      vatId - value to be set
    • setAddresses

      public void setAddresses(BaseAddress... addresses)
      Description copied from interface: CustomerDraft

      Addresses of the Customer.

      Specified by:
      setAddresses in interface CustomerDraft
      Parameters:
      addresses - values to be set
    • setAddresses

      public void setAddresses(List<BaseAddress> addresses)
      Description copied from interface: CustomerDraft

      Addresses of the Customer.

      Specified by:
      setAddresses in interface CustomerDraft
      Parameters:
      addresses - values to be set
    • setDefaultShippingAddress

      public void setDefaultShippingAddress(Integer defaultShippingAddress)
      Description copied from interface: CustomerDraft

      Index of the address in the addresses array to use as the default shipping address. The defaultShippingAddressId of the Customer will be set to the id of that address.

      Specified by:
      setDefaultShippingAddress in interface CustomerDraft
      Parameters:
      defaultShippingAddress - value to be set
    • setShippingAddresses

      public void setShippingAddresses(Integer... shippingAddresses)
      Description copied from interface: CustomerDraft

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      setShippingAddresses in interface CustomerDraft
      Parameters:
      shippingAddresses - values to be set
    • setShippingAddresses

      public void setShippingAddresses(List<Integer> shippingAddresses)
      Description copied from interface: CustomerDraft

      Indices of the shipping addresses in the addresses array. The shippingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      setShippingAddresses in interface CustomerDraft
      Parameters:
      shippingAddresses - values to be set
    • setDefaultBillingAddress

      public void setDefaultBillingAddress(Integer defaultBillingAddress)
      Description copied from interface: CustomerDraft

      Index of the address in the addresses array to use as the default billing address. The defaultBillingAddressId of the Customer will be set to the id of that address.

      Specified by:
      setDefaultBillingAddress in interface CustomerDraft
      Parameters:
      defaultBillingAddress - value to be set
    • setBillingAddresses

      public void setBillingAddresses(Integer... billingAddresses)
      Description copied from interface: CustomerDraft

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      setBillingAddresses in interface CustomerDraft
      Parameters:
      billingAddresses - values to be set
    • setBillingAddresses

      public void setBillingAddresses(List<Integer> billingAddresses)
      Description copied from interface: CustomerDraft

      Indices of the billing addresses in the addresses array. The billingAddressIds of the Customer will be set to the IDs of these addresses.

      Specified by:
      setBillingAddresses in interface CustomerDraft
      Parameters:
      billingAddresses - values to be set
    • setIsEmailVerified

      public void setIsEmailVerified(Boolean isEmailVerified)
      Description copied from interface: CustomerDraft

      Set to true if the email address of the Customer has been verified already. The intended use is to leave this field unset upon sign-up of the Customer and initiate the email verification afterwards.

      Specified by:
      setIsEmailVerified in interface CustomerDraft
      Parameters:
      isEmailVerified - value to be set
    • setCustomerGroup

      public void setCustomerGroup(CustomerGroupResourceIdentifier customerGroup)
      Description copied from interface: CustomerDraft

      Sets the CustomerGroup for the Customer.

      Specified by:
      setCustomerGroup in interface CustomerDraft
      Parameters:
      customerGroup - value to be set
    • setCustom

      public void setCustom(CustomFieldsDraft custom)
      Description copied from interface: CustomerDraft

      Custom Fields for the Customer.

      Specified by:
      setCustom in interface CustomerDraft
      Specified by:
      setCustom in interface CustomizableDraft<CustomerDraft>
      Parameters:
      custom - value to be set
    • setLocale

      public void setLocale(String locale)
      Description copied from interface: CustomerDraft

      Preferred language of the Customer. Must be one of the languages supported by the Project.

      Specified by:
      setLocale in interface CustomerDraft
      Parameters:
      locale - value to be set
    • setSalutation

      public void setSalutation(String salutation)
      Description copied from interface: CustomerDraft

      Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.

      Specified by:
      setSalutation in interface CustomerDraft
      Parameters:
      salutation - value to be set
    • setStores

      public void setStores(StoreResourceIdentifier... stores)
      Description copied from interface: CustomerDraft

      Sets the Stores for the Customer.

      • If no Stores are specified, the Customer is a global customer, and can log in using the Password Flow for global Customers.
      • If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
      Specified by:
      setStores in interface CustomerDraft
      Parameters:
      stores - values to be set
    • setStores

      public void setStores(List<StoreResourceIdentifier> stores)
      Description copied from interface: CustomerDraft

      Sets the Stores for the Customer.

      • If no Stores are specified, the Customer is a global customer, and can log in using the Password Flow for global Customers.
      • If any Stores are specified, the Customer can only log in using the Password Flow for Customers in a Store for those specific Stores.
      Specified by:
      setStores in interface CustomerDraft
      Parameters:
      stores - values to be set
    • setAuthenticationMode

      public void setAuthenticationMode(AuthenticationMode authenticationMode)
      Description copied from interface: CustomerDraft
      • Set to Password to make the password field required for the Customer.
      • Set to ExternalAuth when the password is not required for the Customer.
      Specified by:
      setAuthenticationMode in interface CustomerDraft
      Parameters:
      authenticationMode - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object