Class CompanyDraftBuilder
- All Implemented Interfaces:
Builder<CompanyDraft>
Example to create an instance using the builder pattern
CompanyDraft companyDraft = CompanyDraft.builder()
.key("{key}")
.name("{name}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAddresses
(Function<BaseAddressBuilder, BaseAddress> builder) Addresses used by the Business Unit.List of members that are part of the Business Unit in specific roles.addresses
(BaseAddress... addresses) Addresses used by the Business Unit.addresses
(List<BaseAddress> addresses) Addresses used by the Business Unit.Sets the Stores the Business Unit is associated with.approvalRuleMode
(BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether the Business Unit can inherit Approval Rules from a parent.associateMode
(BusinessUnitAssociateMode associateMode) Determines whether the Business Unit can inherit Associates from a parent.associates
(AssociateDraft... associates) List of members that are part of the Business Unit in specific roles.associates
(List<AssociateDraft> associates) List of members that are part of the Business Unit in specific roles.billingAddresses
(Integer... billingAddresses) Indexes of entries inaddresses
to set as billing addresses.billingAddresses
(List<Integer> billingAddresses) Indexes of entries inaddresses
to set as billing addresses.build()
builds CompanyDraft with checking for non-null required valuesbuilds CompanyDraft without checking for non-null required valuescontactEmail
(String contactEmail) Email address of the Business Unit.custom
(CustomFieldsDraft custom) Custom Fields for the Business Unit.Custom Fields for the Business Unit.defaultBillingAddress
(Integer defaultBillingAddress) Index of the entry inaddresses
to set as the default billing address.defaultShippingAddress
(Integer defaultShippingAddress) Index of the entry inaddresses
to set as the default shipping address.Addresses used by the Business Unit.Determines whether the Business Unit can inherit Approval Rules from a parent.Determines whether the Business Unit can inherit Associates from a parent.List of members that are part of the Business Unit in specific roles.Indexes of entries inaddresses
to set as billing addresses.Email address of the Business Unit.Custom Fields for the Business Unit.Index of the entry inaddresses
to set as the default billing address.Index of the entry inaddresses
to set as the default shipping address.getKey()
User-defined unique and immutable identifier for the Business Unit.getName()
Name of the Business Unit.Indexes of entries inaddresses
to set as shipping addresses.Indicates whether the Business Unit can be edited and used in Orders.Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.Sets the Stores the Business Unit is associated with.User-defined unique and immutable identifier for the Business Unit.Name of the Business Unit.static CompanyDraftBuilder
of()
factory method for an instance of CompanyDraftBuilderstatic CompanyDraftBuilder
of
(CompanyDraft template) create builder for CompanyDraft instanceplusAddresses
(BaseAddress... addresses) Addresses used by the Business Unit.Addresses used by the Business Unit.plusAssociates
(AssociateDraft... associates) List of members that are part of the Business Unit in specific roles.List of members that are part of the Business Unit in specific roles.plusBillingAddresses
(Integer... billingAddresses) Indexes of entries inaddresses
to set as billing addresses.plusShippingAddresses
(Integer... shippingAddresses) Indexes of entries inaddresses
to set as shipping addresses.plusStores
(StoreResourceIdentifier... stores) Sets the Stores the Business Unit is associated with.Sets the Stores the Business Unit is associated with.setAddresses
(Function<BaseAddressBuilder, BaseAddress> builder) Addresses used by the Business Unit.List of members that are part of the Business Unit in specific roles.Sets the Stores the Business Unit is associated with.shippingAddresses
(Integer... shippingAddresses) Indexes of entries inaddresses
to set as shipping addresses.shippingAddresses
(List<Integer> shippingAddresses) Indexes of entries inaddresses
to set as shipping addresses.status
(BusinessUnitStatus status) Indicates whether the Business Unit can be edited and used in Orders.storeMode
(BusinessUnitStoreMode storeMode) Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.stores
(StoreResourceIdentifier... stores) Sets the Stores the Business Unit is associated with.stores
(List<StoreResourceIdentifier> stores) Sets the Stores the Business Unit is associated with.Addresses used by the Business Unit.List of members that are part of the Business Unit in specific roles.Custom Fields for the Business Unit.Sets the Stores the Business Unit is associated with.
-
Constructor Details
-
CompanyDraftBuilder
public CompanyDraftBuilder()
-
-
Method Details
-
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
isExplicit
. 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
isExplicit
. 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
isExplicit
. 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
public CompanyDraftBuilder plusStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) Sets the Stores the Business Unit is associated with. Can only be set when
storeMode
isExplicit
. 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
public CompanyDraftBuilder withStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) Sets the Stores the Business Unit is associated with. Can only be set when
storeMode
isExplicit
. 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
public CompanyDraftBuilder addStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) Sets the Stores the Business Unit is associated with. Can only be set when
storeMode
isExplicit
. 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
public CompanyDraftBuilder setStores(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) Sets the Stores the Business Unit is associated with. Can only be set when
storeMode
isExplicit
. 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
Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.
storeMode
is alwaysExplicit
for Companies and defaults toFromParent
for Divisions.- Parameters:
storeMode
- value to be set- Returns:
- Builder
-
name
Name of the Business Unit.
- Parameters:
name
- value to be set- Returns:
- Builder
-
contactEmail
Email address of the Business Unit.
- Parameters:
contactEmail
- value to be set- Returns:
- Builder
-
associateMode
Determines whether the Business Unit can inherit Associates from a parent. Always
Explicit
for Companies and defaults toExplicitAndFromParent
for Divisions.- Parameters:
associateMode
- value to be set- Returns:
- Builder
-
associates
List of members that are part of the Business Unit in specific roles.
- Parameters:
associates
- value to be set- Returns:
- Builder
-
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:
associates
- value to be set- Returns:
- Builder
-
plusAssociates
public CompanyDraftBuilder plusAssociates(Function<AssociateDraftBuilder, AssociateDraftBuilder> builder) List of members that are part of the Business Unit in specific roles.
- Parameters:
builder
- function to build the associates value- Returns:
- Builder
-
withAssociates
public CompanyDraftBuilder withAssociates(Function<AssociateDraftBuilder, AssociateDraftBuilder> builder) 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 CompanyDraftBuilder approvalRuleMode(@Nullable BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether the Business Unit can inherit Approval Rules from a parent. For Companies, the value of this field is always
Explicit
. For Divisions, the default value isExplicitAndFromParent
.- Parameters:
approvalRuleMode
- value to be set- Returns:
- Builder
-
addresses
Addresses used by the Business Unit.
- Parameters:
addresses
- value to be set- Returns:
- Builder
-
addresses
Addresses used by the Business Unit.
- Parameters:
addresses
- value to be set- Returns:
- Builder
-
plusAddresses
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
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
shippingAddresses
- value to be set- Returns:
- Builder
-
shippingAddresses
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
shippingAddresses
- value to be set- Returns:
- Builder
-
plusShippingAddresses
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
shippingAddresses
- value to be set- Returns:
- Builder
-
defaultShippingAddress
Index of the entry in
addresses
to set as the default shipping address.- Parameters:
defaultShippingAddress
- value to be set- Returns:
- Builder
-
billingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
billingAddresses
- value to be set- Returns:
- Builder
-
billingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
billingAddresses
- value to be set- Returns:
- Builder
-
plusBillingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
billingAddresses
- value to be set- Returns:
- Builder
-
defaultBillingAddress
Index of the entry in
addresses
to set as the default billing address.- Parameters:
defaultBillingAddress
- value to be set- Returns:
- Builder
-
custom
public CompanyDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) 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
-
getKey
User-defined unique and immutable identifier for the Business Unit.
- Returns:
- key
-
getStatus
Indicates whether the Business Unit can be edited and used in Orders.
- Returns:
- status
-
getStores
Sets the Stores the Business Unit is associated with. Can only be set when
storeMode
isExplicit
. 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
Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.
storeMode
is alwaysExplicit
for Companies and defaults toFromParent
for Divisions.- Returns:
- storeMode
-
getName
Name of the Business Unit.
- Returns:
- name
-
getContactEmail
Email address of the Business Unit.
- Returns:
- contactEmail
-
getAssociateMode
Determines whether the Business Unit can inherit Associates from a parent. Always
Explicit
for Companies and defaults toExplicitAndFromParent
for Divisions.- Returns:
- associateMode
-
getAssociates
List of members that are part of the Business Unit in specific roles.
- Returns:
- associates
-
getApprovalRuleMode
Determines whether the Business Unit can inherit Approval Rules from a parent. For Companies, the value of this field is always
Explicit
. For Divisions, the default value isExplicitAndFromParent
.- Returns:
- approvalRuleMode
-
getAddresses
Addresses used by the Business Unit.
- Returns:
- addresses
-
getShippingAddresses
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Returns:
- shippingAddresses
-
getDefaultShippingAddress
Index of the entry in
addresses
to set as the default shipping address.- Returns:
- defaultShippingAddress
-
getBillingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Returns:
- billingAddresses
-
getDefaultBillingAddress
Index of the entry in
addresses
to set as the default billing address.- Returns:
- defaultBillingAddress
-
getCustom
Custom Fields for the Business Unit.
- Returns:
- custom
-
build
builds CompanyDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<CompanyDraft>
- Returns:
- CompanyDraft
-
buildUnchecked
builds CompanyDraft without checking for non-null required values- Returns:
- CompanyDraft
-
of
factory method for an instance of CompanyDraftBuilder- Returns:
- builder
-
of
create builder for CompanyDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-