Class CustomerBuilder
Example to create an instance using the builder pattern
Customer customer = Customer.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.email("{email}")
.plusAddresses(addressesBuilder -> addressesBuilder)
.isEmailVerified(true)
.plusStores(storesBuilder -> storesBuilder)
.authenticationMode(AuthenticationMode.PASSWORD)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAddresses
(Function<AddressBuilder, Address> builder) Addresses used by the Customer.Addresses used by the Customer.Addresses used by the Customer.Stores to which the Customer is assigned to.authenticationMode
(AuthenticationMode authenticationMode) Indicates whether thepassword
is required for the Customer.billingAddressIds
(String... billingAddressIds) IDs of addresses inaddresses
used as billing addresses.billingAddressIds
(List<String> billingAddressIds) IDs of addresses inaddresses
used as billing addresses.build()
builds Customer with checking for non-null required valuesbuilds Customer without checking for non-null required valuescompanyName
(String companyName) Company name of the Customer.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the Customer was initially created.IDs and references that created the Customer.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Customer.custom
(CustomFields custom) Custom Fields for the Customer.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields for the Customer.customerGroup
(CustomerGroupReference customerGroup) CustomerGroup to which the Customer belongs.CustomerGroup to which the Customer belongs.customerNumber
(String customerNumber) User-defined unique identifier of the Customer.dateOfBirth
(LocalDate dateOfBirth) Date of birth of the Customer.defaultBillingAddressId
(String defaultBillingAddressId) ID of the address inaddresses
used as the default billing address.defaultShippingAddressId
(String defaultShippingAddressId) ID of the address inaddresses
used as the default shipping address.Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to.externalId
(String externalId) Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).Given name (first name) of the Customer.Addresses used by the Customer.Indicates whether thepassword
is required for the Customer.IDs of addresses inaddresses
used as billing addresses.Company name of the Customer.Date and time (UTC) the Customer was initially created.IDs and references that created the Customer.Custom Fields for the Customer.CustomerGroup to which the Customer belongs.User-defined unique identifier of the Customer.Date of birth of the Customer.ID of the address inaddresses
used as the default billing address.ID of the address inaddresses
used as the default shipping address.getEmail()
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to.Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).Given name (first name) of the Customer.getId()
Unique identifier of the Customer.Indicates whether the email address of the Customer is verified.getKey()
User-defined unique identifier of the Customer.Date and time (UTC) the Customer was last updated.IDs and references that last modified the Customer.Family name (last name) of the Customer.Preferred language of the Customer.Middle name of the Customer.Present only whenauthenticationMode
is set toPassword
.Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.IDs of addresses inaddresses
used as shipping addresses.Stores to which the Customer is assigned to.getTitle()
Title of the Customer, for example, 'Dr.'.getVatId()
Individual VAT ID of the Customer.Current version of the Customer.Unique identifier of the Customer.isEmailVerified
(Boolean isEmailVerified) Indicates whether the email address of the Customer is verified.User-defined unique identifier of the Customer.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Customer was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Customer.IDs and references that last modified the Customer.Family name (last name) of the Customer.Preferred language of the Customer.middleName
(String middleName) Middle name of the Customer.static CustomerBuilder
of()
factory method for an instance of CustomerBuilderstatic CustomerBuilder
create builder for Customer instancePresent only whenauthenticationMode
is set toPassword
.plusAddresses
(Address... addresses) Addresses used by the Customer.plusAddresses
(Function<AddressBuilder, AddressBuilder> builder) Addresses used by the Customer.plusBillingAddressIds
(String... billingAddressIds) IDs of addresses inaddresses
used as billing addresses.plusShippingAddressIds
(String... shippingAddressIds) IDs of addresses inaddresses
used as shipping addresses.plusStores
(StoreKeyReference... stores) Stores to which the Customer is assigned to.Stores to which the Customer is assigned to.salutation
(String salutation) Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.setAddresses
(Function<AddressBuilder, Address> builder) Addresses used by the Customer.Stores to which the Customer is assigned to.shippingAddressIds
(String... shippingAddressIds) IDs of addresses inaddresses
used as shipping addresses.shippingAddressIds
(List<String> shippingAddressIds) IDs of addresses inaddresses
used as shipping addresses.stores
(StoreKeyReference... stores) Stores to which the Customer is assigned to.stores
(List<StoreKeyReference> stores) Stores to which the Customer is assigned to.Title of the Customer, for example, 'Dr.'.Individual VAT ID of the Customer.Current version of the Customer.withAddresses
(Function<AddressBuilder, AddressBuilder> builder) Addresses used by the Customer.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Customer.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields for the Customer.CustomerGroup to which the Customer belongs.IDs and references that last modified the Customer.Stores to which the Customer is assigned to.
-
Constructor Details
-
CustomerBuilder
public CustomerBuilder()
-
-
Method Details
-
id
Unique identifier of the Customer.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Customer.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Customer was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Customer was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Customer.
- Parameters:
key
- value to be set- Returns:
- Builder
-
customerNumber
User-defined unique identifier of the Customer.
Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).
- Parameters:
customerNumber
- value to be set- Returns:
- Builder
-
externalId
Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Parameters:
externalId
- value to be set- Returns:
- Builder
-
lastModifiedBy
public CustomerBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the Customer.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the Customer.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Customer.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Customer.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Customer.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Customer.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
email
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.
- Parameters:
email
- value to be set- Returns:
- Builder
-
password
Present only when
authenticationMode
is set toPassword
.- Parameters:
password
- value to be set- Returns:
- Builder
-
firstName
Given name (first name) of the Customer.
- Parameters:
firstName
- value to be set- Returns:
- Builder
-
lastName
Family name (last name) of the Customer.
- Parameters:
lastName
- value to be set- Returns:
- Builder
-
middleName
Middle name of the Customer.
- Parameters:
middleName
- value to be set- Returns:
- Builder
-
title
Title of the Customer, for example, 'Dr.'.
- Parameters:
title
- value to be set- Returns:
- Builder
-
dateOfBirth
Date of birth of the Customer.
- Parameters:
dateOfBirth
- value to be set- Returns:
- Builder
-
companyName
Company name of the Customer.
- Parameters:
companyName
- value to be set- Returns:
- Builder
-
vatId
Individual VAT ID of the Customer.
- Parameters:
vatId
- value to be set- Returns:
- Builder
-
addresses
Addresses used by the Customer.
- Parameters:
addresses
- value to be set- Returns:
- Builder
-
addresses
Addresses used by the Customer.
- Parameters:
addresses
- value to be set- Returns:
- Builder
-
plusAddresses
Addresses used by the Customer.
- Parameters:
addresses
- value to be set- Returns:
- Builder
-
plusAddresses
Addresses used by the Customer.
- Parameters:
builder
- function to build the addresses value- Returns:
- Builder
-
withAddresses
Addresses used by the Customer.
- Parameters:
builder
- function to build the addresses value- Returns:
- Builder
-
addAddresses
Addresses used by the Customer.
- Parameters:
builder
- function to build the addresses value- Returns:
- Builder
-
setAddresses
Addresses used by the Customer.
- Parameters:
builder
- function to build the addresses value- Returns:
- Builder
-
defaultShippingAddressId
ID of the address in
addresses
used as the default shipping address.- Parameters:
defaultShippingAddressId
- value to be set- Returns:
- Builder
-
shippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
shippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
plusShippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
defaultBillingAddressId
ID of the address in
addresses
used as the default billing address.- Parameters:
defaultBillingAddressId
- value to be set- Returns:
- Builder
-
billingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
billingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
plusBillingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
isEmailVerified
Indicates whether the email address of the Customer is verified.
- Parameters:
isEmailVerified
- value to be set- Returns:
- Builder
-
customerGroup
public CustomerBuilder customerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReferenceBuilder> builder) CustomerGroup to which the Customer belongs.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
withCustomerGroup
public CustomerBuilder withCustomerGroup(Function<CustomerGroupReferenceBuilder, CustomerGroupReference> builder) CustomerGroup to which the Customer belongs.
- Parameters:
builder
- function to build the customerGroup value- Returns:
- Builder
-
customerGroup
CustomerGroup to which the Customer belongs.
- Parameters:
customerGroup
- value to be set- Returns:
- Builder
-
custom
Custom Fields for the Customer.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Customer.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Customer.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
locale
Preferred language of the Customer.
- Parameters:
locale
- value to be set- Returns:
- Builder
-
salutation
Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Parameters:
salutation
- value to be set- Returns:
- Builder
-
stores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
stores
- value to be set- Returns:
- Builder
- If
-
stores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
stores
- value to be set- Returns:
- Builder
- If
-
plusStores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
stores
- value to be set- Returns:
- Builder
- If
-
plusStores
public CustomerBuilder plusStores(Function<StoreKeyReferenceBuilder, StoreKeyReferenceBuilder> builder) Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
builder
- function to build the stores value- Returns:
- Builder
- If
-
withStores
public CustomerBuilder withStores(Function<StoreKeyReferenceBuilder, StoreKeyReferenceBuilder> builder) Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
builder
- function to build the stores value- Returns:
- Builder
- If
-
addStores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
builder
- function to build the stores value- Returns:
- Builder
- If
-
setStores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Parameters:
builder
- function to build the stores value- Returns:
- Builder
- If
-
authenticationMode
Indicates whether the
password
is required for the Customer.- Parameters:
authenticationMode
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Customer.
- Returns:
- id
-
getVersion
Current version of the Customer.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Customer was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Customer was last updated.
- Returns:
- lastModifiedAt
-
getKey
User-defined unique identifier of the Customer.
- Returns:
- key
-
getCustomerNumber
User-defined unique identifier of the Customer.
Can be used to refer to a Customer in a human-readable way (in emails, invoices, and other correspondence).
- Returns:
- customerNumber
-
getExternalId
Optional identifier for use in external systems like customer relationship management (CRM) or enterprise resource planning (ERP).
- Returns:
- externalId
-
getLastModifiedBy
IDs and references that last modified the Customer.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Customer.
- Returns:
- createdBy
-
getEmail
Email address of the Customer that is unique for an entire Project or to a Store the Customer is assigned to. It is the mandatory unique identifier of a Customer.
- Returns:
-
getPassword
Present only when
authenticationMode
is set toPassword
.- Returns:
- password
-
getFirstName
Given name (first name) of the Customer.
- Returns:
- firstName
-
getLastName
Family name (last name) of the Customer.
- Returns:
- lastName
-
getMiddleName
Middle name of the Customer.
- Returns:
- middleName
-
getTitle
Title of the Customer, for example, 'Dr.'.
- Returns:
- title
-
getDateOfBirth
Date of birth of the Customer.
- Returns:
- dateOfBirth
-
getCompanyName
Company name of the Customer.
- Returns:
- companyName
-
getVatId
Individual VAT ID of the Customer.
- Returns:
- vatId
-
getAddresses
Addresses used by the Customer.
- Returns:
- addresses
-
getDefaultShippingAddressId
ID of the address in
addresses
used as the default shipping address.- Returns:
- defaultShippingAddressId
-
getShippingAddressIds
IDs of addresses in
addresses
used as shipping addresses.- Returns:
- shippingAddressIds
-
getDefaultBillingAddressId
ID of the address in
addresses
used as the default billing address.- Returns:
- defaultBillingAddressId
-
getBillingAddressIds
IDs of addresses in
addresses
used as billing addresses.- Returns:
- billingAddressIds
-
getIsEmailVerified
Indicates whether the email address of the Customer is verified.
- Returns:
- isEmailVerified
-
getCustomerGroup
CustomerGroup to which the Customer belongs.
- Returns:
- customerGroup
-
getCustom
Custom Fields for the Customer.
- Returns:
- custom
-
getLocale
Preferred language of the Customer.
- Returns:
- locale
-
getSalutation
Salutation of the Customer, for example, 'Mr.' or 'Mrs.'.
- Returns:
- salutation
-
getStores
Stores to which the Customer is assigned to.
- If
stores
is empty, 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.
- Returns:
- stores
- If
-
getAuthenticationMode
Indicates whether the
password
is required for the Customer.- Returns:
- authenticationMode
-
build
builds Customer with checking for non-null required values -
buildUnchecked
builds Customer without checking for non-null required values- Returns:
- Customer
-
of
factory method for an instance of CustomerBuilder- Returns:
- builder
-
of
create builder for Customer instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-