Class DivisionBuilder
Example to create an instance using the builder pattern
Division division = Division.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.key("{key}")
.status(BusinessUnitStatus.ACTIVE)
.storeMode(BusinessUnitStoreMode.EXPLICIT)
.name("{name}")
.plusAddresses(addressesBuilder -> addressesBuilder)
.associateMode(BusinessUnitAssociateMode.EXPLICIT)
.plusAssociates(associatesBuilder -> associatesBuilder)
.parentUnit(parentUnitBuilder -> parentUnitBuilder)
.topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
.approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAddresses
(Function<AddressBuilder, Address> builder) Addresses used by the Business Unit.addAssociates
(Function<AssociateBuilder, Associate> builder) Associates that are part of the Business Unit in specific roles.Associates that are inherited from a parent Business Unit.Addresses used by the Business Unit.Addresses used by the Business Unit.References to Stores the Business Unit is associated with.approvalRuleMode
(BusinessUnitApprovalRuleMode approvalRuleMode) Determines whether a Business Unit can inherit Approval Rules from a parent.associateMode
(BusinessUnitAssociateMode associateMode) Determines whether the Division can inherit Associates from a parent.associates
(Associate... associates) Associates that are part of the Business Unit in specific roles.associates
(List<Associate> associates) Associates that are part of the Business Unit in specific roles.billingAddressIds
(String... billingAddressIds) Unique identifiers of addresses used as billing addresses.billingAddressIds
(List<String> billingAddressIds) Unique identifiers of addresses used as billing addresses.build()
builds Division with checking for non-null required valuesbuilds Division without checking for non-null required valuescontactEmail
(String contactEmail) Email address of the Business Unit.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the Business Unit was initially created.IDs and references that created the BusinessUnit.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the BusinessUnit.custom
(CustomFields custom) Custom Fields for the Business Unit.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields for the Business Unit.defaultBillingAddressId
(String defaultBillingAddressId) Unique identifier of the address used as the default billing address.defaultShippingAddressId
(String defaultShippingAddressId) Unique identifier of the address used as the default shipping address.Addresses used by the Business Unit.Determines whether a Business Unit can inherit Approval Rules from a parent.Determines whether the Division can inherit Associates from a parent.Associates that are part of the Business Unit in specific roles.Unique identifiers of addresses used as billing addresses.Email address of the Business Unit.Date and time (UTC) the Business Unit was initially created.IDs and references that created the BusinessUnit.Custom Fields for the Business Unit.Unique identifier of the address used as the default billing address.Unique identifier of the address used as the default shipping address.getId()
Unique identifier of the Business Unit.Associates that are inherited from a parent Business Unit.getKey()
User-defined unique and immutable identifier of the Business Unit.Date and time (UTC) the Business Unit was last updated.IDs and references that last modified the BusinessUnit.getName()
Name of the Business Unit.Parent unit of the Division.Unique identifiers of addresses used as shipping addresses.Indicates whether the Business Unit can be edited and used in Orders.Defines whether the Stores of the Division are set explicitly or inherited from a parent Business Unit.References to Stores the Business Unit is associated with.Top-level unit of the Business Unit.Current version of the Business Unit.Unique identifier of the Business Unit.inheritedAssociates
(InheritedAssociate... inheritedAssociates) Associates that are inherited from a parent Business Unit.inheritedAssociates
(List<InheritedAssociate> inheritedAssociates) Associates that are inherited from a parent Business Unit.User-defined unique and immutable identifier of the Business Unit.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Business Unit was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the BusinessUnit.IDs and references that last modified the BusinessUnit.Name of the Business Unit.static DivisionBuilder
of()
factory method for an instance of DivisionBuilderstatic DivisionBuilder
create builder for Division instanceparentUnit
(BusinessUnitKeyReference parentUnit) Parent unit of the Division.Parent unit of the Division.plusAddresses
(Address... addresses) Addresses used by the Business Unit.plusAddresses
(Function<AddressBuilder, AddressBuilder> builder) Addresses used by the Business Unit.plusAssociates
(Associate... associates) Associates that are part of the Business Unit in specific roles.Associates that are part of the Business Unit in specific roles.plusBillingAddressIds
(String... billingAddressIds) Unique identifiers of addresses used as billing addresses.plusInheritedAssociates
(InheritedAssociate... inheritedAssociates) Associates that are inherited from a parent Business Unit.Associates that are inherited from a parent Business Unit.plusShippingAddressIds
(String... shippingAddressIds) Unique identifiers of addresses used as shipping addresses.plusStores
(StoreKeyReference... stores) References to Stores the Business Unit is associated with.References to Stores the Business Unit is associated with.setAddresses
(Function<AddressBuilder, Address> builder) Addresses used by the Business Unit.setAssociates
(Function<AssociateBuilder, Associate> builder) Associates that are part of the Business Unit in specific roles.Associates that are inherited from a parent Business Unit.References to Stores the Business Unit is associated with.shippingAddressIds
(String... shippingAddressIds) Unique identifiers of addresses used as shipping addresses.shippingAddressIds
(List<String> shippingAddressIds) Unique identifiers of addresses used 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 Division are set explicitly or inherited from a parent Business Unit.stores
(StoreKeyReference... stores) References to Stores the Business Unit is associated with.stores
(List<StoreKeyReference> stores) References to Stores the Business Unit is associated with.topLevelUnit
(BusinessUnitKeyReference topLevelUnit) Top-level unit of the Business Unit.Top-level unit of the Business Unit.Current version of the Business Unit.withAddresses
(Function<AddressBuilder, AddressBuilder> builder) Addresses used by the Business Unit.Associates that are part of the Business Unit in specific roles.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the BusinessUnit.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields for the Business Unit.Associates that are inherited from a parent Business Unit.IDs and references that last modified the BusinessUnit.Parent unit of the Division.References to Stores the Business Unit is associated with.Top-level unit of the Business Unit.
-
Constructor Details
-
DivisionBuilder
public DivisionBuilder()
-
-
Method Details
-
id
Unique identifier of the Business Unit.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Business Unit.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Business Unit was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
public DivisionBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the BusinessUnit.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the BusinessUnit.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the BusinessUnit.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the BusinessUnit.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the BusinessUnit.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the BusinessUnit.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
key
User-defined unique and immutable identifier of 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
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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 DivisionBuilder plusStores(Function<StoreKeyReferenceBuilder, StoreKeyReferenceBuilder> builder) References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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 DivisionBuilder withStores(Function<StoreKeyReferenceBuilder, StoreKeyReferenceBuilder> builder) References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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 Division are set explicitly or inherited from a parent Business Unit.
- 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
-
custom
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
-
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
-
shippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
shippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
plusShippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Parameters:
shippingAddressIds
- value to be set- Returns:
- Builder
-
defaultShippingAddressId
Unique identifier of the address used as the default shipping address.
- Parameters:
defaultShippingAddressId
- value to be set- Returns:
- Builder
-
billingAddressIds
Unique identifiers of addresses used as billing addresses.
- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
billingAddressIds
Unique identifiers of addresses used as billing addresses.
- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
plusBillingAddressIds
Unique identifiers of addresses used as billing addresses.
- Parameters:
billingAddressIds
- value to be set- Returns:
- Builder
-
defaultBillingAddressId
Unique identifier of the address used as the default billing address.
- Parameters:
defaultBillingAddressId
- 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
Associates that are part of the Business Unit in specific roles.
- Parameters:
associates
- value to be set- Returns:
- Builder
-
associates
Associates that are part of the Business Unit in specific roles.
- Parameters:
associates
- value to be set- Returns:
- Builder
-
plusAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
associates
- value to be set- Returns:
- Builder
-
plusAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
builder
- function to build the associates value- Returns:
- Builder
-
withAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
builder
- function to build the associates value- Returns:
- Builder
-
addAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
builder
- function to build the associates value- Returns:
- Builder
-
setAssociates
Associates that are part of the Business Unit in specific roles.
- Parameters:
builder
- function to build the associates value- Returns:
- Builder
-
inheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
inheritedAssociates
- value to be set- Returns:
- Builder
-
inheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
inheritedAssociates
- value to be set- Returns:
- Builder
-
plusInheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
inheritedAssociates
- value to be set- Returns:
- Builder
-
plusInheritedAssociates
public DivisionBuilder plusInheritedAssociates(Function<InheritedAssociateBuilder, InheritedAssociateBuilder> builder) Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
builder
- function to build the inheritedAssociates value- Returns:
- Builder
-
withInheritedAssociates
public DivisionBuilder withInheritedAssociates(Function<InheritedAssociateBuilder, InheritedAssociateBuilder> builder) Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
builder
- function to build the inheritedAssociates value- Returns:
- Builder
-
addInheritedAssociates
public DivisionBuilder addInheritedAssociates(Function<InheritedAssociateBuilder, InheritedAssociate> builder) Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
builder
- function to build the inheritedAssociates value- Returns:
- Builder
-
setInheritedAssociates
public DivisionBuilder setInheritedAssociates(Function<InheritedAssociateBuilder, InheritedAssociate> builder) Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Parameters:
builder
- function to build the inheritedAssociates value- Returns:
- Builder
-
parentUnit
public DivisionBuilder parentUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReferenceBuilder> builder) Parent unit of the Division.
- Parameters:
builder
- function to build the parentUnit value- Returns:
- Builder
-
withParentUnit
public DivisionBuilder withParentUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReference> builder) Parent unit of the Division.
- Parameters:
builder
- function to build the parentUnit value- Returns:
- Builder
-
parentUnit
Parent unit of the Division.
- Parameters:
parentUnit
- value to be set- Returns:
- Builder
-
topLevelUnit
public DivisionBuilder topLevelUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReferenceBuilder> builder) Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Parameters:
builder
- function to build the topLevelUnit value- Returns:
- Builder
-
withTopLevelUnit
public DivisionBuilder withTopLevelUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReference> builder) Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Parameters:
builder
- function to build the topLevelUnit value- Returns:
- Builder
-
topLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Parameters:
topLevelUnit
- value to be set- Returns:
- Builder
-
approvalRuleMode
Determines whether a Business Unit can inherit Approval Rules from a parent.
- Parameters:
approvalRuleMode
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Business Unit.
- Returns:
- id
-
getVersion
Current version of the Business Unit.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Business Unit was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Business Unit was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the BusinessUnit.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the BusinessUnit.
- Returns:
- createdBy
-
getKey
User-defined unique and immutable identifier of the Business Unit.
- Returns:
- key
-
getStatus
Indicates whether the Business Unit can be edited and used in Orders.
- Returns:
- status
-
getStores
References to Stores the Business Unit is associated with. Only present when
storeMode
isExplicit
.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 Division are set explicitly or inherited from a parent Business Unit.
- Returns:
- storeMode
-
getName
Name of the Business Unit.
- Returns:
- name
-
getContactEmail
Email address of the Business Unit.
- Returns:
- contactEmail
-
getCustom
Custom Fields for the Business Unit.
- Returns:
- custom
-
getAddresses
Addresses used by the Business Unit.
- Returns:
- addresses
-
getShippingAddressIds
Unique identifiers of addresses used as shipping addresses.
- Returns:
- shippingAddressIds
-
getDefaultShippingAddressId
Unique identifier of the address used as the default shipping address.
- Returns:
- defaultShippingAddressId
-
getBillingAddressIds
Unique identifiers of addresses used as billing addresses.
- Returns:
- billingAddressIds
-
getDefaultBillingAddressId
Unique identifier of the address used as the default billing address.
- Returns:
- defaultBillingAddressId
-
getAssociateMode
Determines whether the Division can inherit Associates from a parent.
- Returns:
- associateMode
-
getAssociates
Associates that are part of the Business Unit in specific roles.
- Returns:
- associates
-
getInheritedAssociates
Associates that are inherited from a parent Business Unit. The value of this field is eventually consistent and is only present when the
associateMode
is set toExplicitAndFromParent
.- Returns:
- inheritedAssociates
-
getParentUnit
Parent unit of the Division.
- Returns:
- parentUnit
-
getTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Returns:
- topLevelUnit
-
getApprovalRuleMode
Determines whether a Business Unit can inherit Approval Rules from a parent.
- Returns:
- approvalRuleMode
-
build
builds Division with checking for non-null required values -
buildUnchecked
builds Division without checking for non-null required values- Returns:
- Division
-
of
factory method for an instance of DivisionBuilder- Returns:
- builder
-
of
create builder for Division instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-