Interface BusinessUnitDraft
- All Superinterfaces:
WithKey
- All Known Subinterfaces:
CompanyDraft
,DivisionDraft
- All Known Implementing Classes:
BusinessUnitDraftImpl
,CompanyDraftImpl
,DivisionDraftImpl
Generic draft type to model those fields all Business Units have in common. The additional fields required for creating a Company or Division are represented on CompanyDraft and DivisionDraft.
Example to create a subtype instance using the builder pattern
BusinessUnitDraft businessUnitDraft = BusinessUnitDraft.companyBuilder()
key("{key}")
name("{name}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompanyDraftBuilder
builder for company subtypestatic BusinessUnitDraft
deepCopy
(BusinessUnitDraft template) factory method to create a deep copy of BusinessUnitDraftstatic DivisionDraftBuilder
builder for division subtype@Valid List<BaseAddress>
Addresses used by the Business Unit.Determines whether the Business Unit can inherit Associates from a parent.@Valid List<AssociateDraft>
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.@Valid CustomFieldsDraft
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.@NotNull String
getKey()
User-defined unique identifier for the Business Unit.@NotNull String
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.@Valid List<StoreResourceIdentifier>
Sets the Stores the Business Unit is associated with.@NotNull BusinessUnitType
Type of the Business Unit indicating its position in a hierarchy.void
setAddresses
(BaseAddress... addresses) Addresses used by the Business Unit.void
setAddresses
(List<BaseAddress> addresses) Addresses used by the Business Unit.void
setAssociateMode
(BusinessUnitAssociateMode associateMode) Determines whether the Business Unit can inherit Associates from a parent.void
setAssociates
(AssociateDraft... associates) List of members that are part of the Business Unit in specific roles.void
setAssociates
(List<AssociateDraft> associates) List of members that are part of the Business Unit in specific roles.void
setBillingAddresses
(Integer... billingAddresses) Indexes of entries inaddresses
to set as billing addresses.void
setBillingAddresses
(List<Integer> billingAddresses) Indexes of entries inaddresses
to set as billing addresses.void
setContactEmail
(String contactEmail) Email address of the Business Unit.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Business Unit.void
setDefaultBillingAddress
(Integer defaultBillingAddress) Index of the entry inaddresses
to set as the default billing address.void
setDefaultShippingAddress
(Integer defaultShippingAddress) Index of the entry inaddresses
to set as the default shipping address.void
User-defined unique identifier for the Business Unit.void
Name of the Business Unit.void
setShippingAddresses
(Integer... shippingAddresses) Indexes of entries inaddresses
to set as shipping addresses.void
setShippingAddresses
(List<Integer> shippingAddresses) Indexes of entries inaddresses
to set as shipping addresses.void
setStatus
(BusinessUnitStatus status) Indicates whether the Business Unit can be edited and used in Orders.void
setStoreMode
(BusinessUnitStoreMode storeMode) Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent.void
setStores
(StoreResourceIdentifier... stores) Sets the Stores the Business Unit is associated with.void
setStores
(List<StoreResourceIdentifier> stores) Sets the Stores the Business Unit is associated with.static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withBusinessUnitDraft
(Function<BusinessUnitDraft, T> helper) accessor map function
-
Method Details
-
getKey
User-defined unique identifier for the Business Unit.
-
getStatus
BusinessUnitStatus 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
BusinessUnitStoreMode 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
-
getUnitType
Type of the Business Unit indicating its position in a hierarchy.
- Returns:
- unitType
-
getName
Name of the Business Unit.
- Returns:
- name
-
getContactEmail
String getContactEmail()Email address of the Business Unit.
- Returns:
- contactEmail
-
getAssociateMode
BusinessUnitAssociateMode 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
-
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
Integer 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
Integer 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
-
setKey
User-defined unique identifier for the Business Unit.
- Parameters:
key
- value to be set
-
setStatus
Indicates whether the Business Unit can be edited and used in Orders.
- Parameters:
status
- value to be set
-
setStores
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
- values to be set
-
setStores
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
- values to be set
-
setStoreMode
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
-
setName
Name of the Business Unit.
- Parameters:
name
- value to be set
-
setContactEmail
Email address of the Business Unit.
- Parameters:
contactEmail
- value to be set
-
setAssociateMode
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
-
setAssociates
List of members that are part of the Business Unit in specific roles.
- Parameters:
associates
- values to be set
-
setAssociates
List of members that are part of the Business Unit in specific roles.
- Parameters:
associates
- values to be set
-
setAddresses
Addresses used by the Business Unit.
- Parameters:
addresses
- values to be set
-
setAddresses
Addresses used by the Business Unit.
- Parameters:
addresses
- values to be set
-
setShippingAddresses
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
shippingAddresses
- values to be set
-
setShippingAddresses
Indexes of entries in
addresses
to set as shipping addresses. TheshippingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
shippingAddresses
- values to be set
-
setDefaultShippingAddress
Index of the entry in
addresses
to set as the default shipping address.- Parameters:
defaultShippingAddress
- value to be set
-
setBillingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
billingAddresses
- values to be set
-
setBillingAddresses
Indexes of entries in
addresses
to set as billing addresses. ThebillingAddressIds
of the Customer will be replaced by these addresses.- Parameters:
billingAddresses
- values to be set
-
setDefaultBillingAddress
Index of the entry in
addresses
to set as the default billing address.- Parameters:
defaultBillingAddress
- value to be set
-
setCustom
Custom Fields for the Business Unit.
- Parameters:
custom
- value to be set
-
deepCopy
factory method to create a deep copy of BusinessUnitDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
companyBuilder
builder for company subtype- Returns:
- builder
-
divisionBuilder
builder for division subtype- Returns:
- builder
-
withBusinessUnitDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-