Class DivisionDraftBuilder
- All Implemented Interfaces:
Builder<DivisionDraft>
Example to create an instance using the builder pattern
DivisionDraft divisionDraft = DivisionDraft.builder()
.key("{key}")
.name("{name}")
.parentUnit(parentUnitBuilder -> parentUnitBuilder)
.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 Division can inherit Approval Rules from a parent.associateMode
(BusinessUnitAssociateMode associateMode) Determines whether the Division 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 DivisionDraft with checking for non-null required valuesbuilds DivisionDraft 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 Division can inherit Approval Rules from a parent.Determines whether the Division 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.The parent unit of this Division.Indexes of entries inaddresses
to set as shipping addresses.Indicates whether the Business Unit can be edited and used in Orders.If not set, the Division inherits the Stores from a parent unit.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 DivisionDraftBuilder
of()
factory method for an instance of DivisionDraftBuilderstatic DivisionDraftBuilder
of
(DivisionDraft template) create builder for DivisionDraft instanceparentUnit
(BusinessUnitResourceIdentifier parentUnit) The parent unit of this Division.parentUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) The parent unit of this Division.plusAddresses
(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) If not set, the Division inherits the Stores from a parent unit.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.withParentUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) The parent unit of this Division.Sets the Stores the Business Unit is associated with.
-
Constructor Details
-
DivisionDraftBuilder
public DivisionDraftBuilder()
-
-
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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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
If not set, the Division inherits the Stores from a parent unit. Set this to
Explicit
if you want to set the Stores explicitly in thestores
field instead.- 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 Division can inherit Associates from a parent.
- 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 DivisionDraftBuilder 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 DivisionDraftBuilder 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 DivisionDraftBuilder approvalRuleMode(@Nullable BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether the Division can inherit Approval Rules from a parent.
- 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 DivisionDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Business Unit.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public DivisionDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) 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
-
parentUnit
public DivisionDraftBuilder parentUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) The parent unit of this Division. Can be a Company or a Division.
- Parameters:
builder
- function to build the parentUnit value- Returns:
- Builder
-
withParentUnit
public DivisionDraftBuilder withParentUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) 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
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
If not set, the Division inherits the Stores from a parent unit. Set this to
Explicit
if you want to set the Stores explicitly in thestores
field instead.- Returns:
- storeMode
-
getName
Name of the Business Unit.
- Returns:
- name
-
getContactEmail
Email address of the Business Unit.
- Returns:
- contactEmail
-
getAssociateMode
Determines whether the Division can inherit Associates from a parent.
- Returns:
- associateMode
-
getAssociates
List of members that are part of the Business Unit in specific roles.
- Returns:
- associates
-
getApprovalRuleMode
Determines whether the Division can inherit Approval Rules from a parent.
- 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
-
getParentUnit
The parent unit of this Division. Can be a Company or a Division.
- Returns:
- parentUnit
-
build
builds DivisionDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<DivisionDraft>
- Returns:
- DivisionDraft
-
buildUnchecked
builds DivisionDraft without checking for non-null required values- Returns:
- DivisionDraft
-
of
factory method for an instance of DivisionDraftBuilder- Returns:
- builder
-
of
create builder for DivisionDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-