Class CompanyBuilder
Example to create an instance using the builder pattern
Company company = Company.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)
.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) The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.associateMode
(BusinessUnitAssociateMode associateMode) The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Associates can be inherited from.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 Company with checking for non-null required valuesbuilds Company 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.The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Associates can be inherited from.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 Business Unit.Unique identifiers of addresses used as shipping addresses.Indicates whether the Business Unit can be edited and used in Orders.The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Stores can be inherited from.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 CompanyBuilder
of()
factory method for an instance of CompanyBuilderstatic CompanyBuilder
create builder for Company instanceparentUnit
(BusinessUnitKeyReference parentUnit) Parent unit of the Business Unit.Parent unit of the Business Unit.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) The value of this field is alwaysExplicit
because a Company cannot have a parent Business Unit that Stores can be inherited from.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 Business Unit.References to Stores the Business Unit is associated with.Top-level unit of the Business Unit.
-
Constructor Details
-
CompanyBuilder
public CompanyBuilder()
-
-
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
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 CompanyBuilder 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 CompanyBuilder 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
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Stores can be inherited from.- 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
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Associates can be inherited from.- 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 CompanyBuilder 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 CompanyBuilder 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 CompanyBuilder 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 CompanyBuilder 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 CompanyBuilder parentUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReferenceBuilder> builder) Parent unit of the Business Unit. Only present when the
unitType
isDivision
.- Parameters:
builder
- function to build the parentUnit value- Returns:
- Builder
-
withParentUnit
public CompanyBuilder withParentUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReference> builder) Parent unit of the Business Unit. Only present when the
unitType
isDivision
.- Parameters:
builder
- function to build the parentUnit value- Returns:
- Builder
-
parentUnit
Parent unit of the Business Unit. Only present when the
unitType
isDivision
.- Parameters:
parentUnit
- value to be set- Returns:
- Builder
-
topLevelUnit
public CompanyBuilder 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 CompanyBuilder 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
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.- 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
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Stores can be inherited from.- 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
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Associates can be inherited from.- 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 Business Unit. Only present when the
unitType
isDivision
.- Returns:
- parentUnit
-
getTopLevelUnit
Top-level unit of the Business Unit. The top-level unit is of
unitType
Company
.- Returns:
- topLevelUnit
-
getApprovalRuleMode
The value of this field is always
Explicit
because a Company cannot have a parent Business Unit that Approval Rules can be inherited from.- Returns:
- approvalRuleMode
-
build
builds Company with checking for non-null required values -
buildUnchecked
builds Company without checking for non-null required values- Returns:
- Company
-
of
factory method for an instance of CompanyBuilder- Returns:
- builder
-
of
create builder for Company instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-