Class MyCartDraftBuilder
- All Implemented Interfaces:
Builder<MyCartDraft>
Example to create an instance using the builder pattern
MyCartDraft myCartDraft = MyCartDraft.builder()
.currency("{currency}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMultiple shipping addresses of the Cart.Line Items to add to the Cart.billingAddress
(BaseAddress billingAddress) Billing address associated with the Cart.Billing address associated with the Cart.build()
builds MyCartDraft with checking for non-null required valuesbuilds MyCartDraft without checking for non-null required valuesbusinessUnit
(BusinessUnitResourceIdentifier businessUnit) ResourceIdentifier to the Business Unit the Cart should belong to.businessUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) ResourceIdentifier to the Business Unit the Cart should belong to.Used for Line Item price selection.Currency the Cart uses.custom
(CustomFieldsDraft custom) Custom Fields for the Cart.Custom Fields for the Cart.customerEmail
(String customerEmail) Email address of the Customer the Cart belongs to.deleteDaysAfterLastModification
(Long deleteDaysAfterLastModification) Number of days after which a Cart withActive
CartState is deleted since its last modification.discountCodes
(String... discountCodes) code
of the existing DiscountCodes to add to the Cart.discountCodes
(List<String> discountCodes) code
of the existing DiscountCodes to add to the Cart.Billing address associated with the Cart.ResourceIdentifier to the Business Unit the Cart should belong to.Used for Line Item price selection.Currency the Cart uses.Custom Fields for the Cart.Email address of the Customer the Cart belongs to.Number of days after which a Cart withActive
CartState is deleted since its last modification.code
of the existing DiscountCodes to add to the Cart.Determines how stock quantities are tracked for Line Items in the Cart.Multiple shipping addresses of the Cart.Line Items to add to the Cart.Languages of the Cart.Shipping address associated with the Cart.Shipping Method for the Cart.If set toSingle
, only a single Shipping Method can be added to the Cart. If set toMultiple
, multiple Shipping Methods can be added to the Cart.getStore()
ResourceIdentifier to the Store the Cart should belong to.Determines how Tax Rates are set.inventoryMode
(InventoryMode inventoryMode) Determines how stock quantities are tracked for Line Items in the Cart.itemShippingAddresses
(BaseAddress... itemShippingAddresses) Multiple shipping addresses of the Cart.itemShippingAddresses
(List<BaseAddress> itemShippingAddresses) Multiple shipping addresses of the Cart.lineItems
(MyLineItemDraft... lineItems) Line Items to add to the Cart.lineItems
(List<MyLineItemDraft> lineItems) Line Items to add to the Cart.Languages of the Cart.static MyCartDraftBuilder
of()
factory method for an instance of MyCartDraftBuilderstatic MyCartDraftBuilder
of
(MyCartDraft template) create builder for MyCartDraft instanceplusDiscountCodes
(String... discountCodes) code
of the existing DiscountCodes to add to the Cart.plusItemShippingAddresses
(BaseAddress... itemShippingAddresses) Multiple shipping addresses of the Cart.Multiple shipping addresses of the Cart.plusLineItems
(MyLineItemDraft... lineItems) Line Items to add to the Cart.Line Items to add to the Cart.Multiple shipping addresses of the Cart.Line Items to add to the Cart.shippingAddress
(BaseAddress shippingAddress) Shipping address associated with the Cart.Shipping address associated with the Cart.shippingMethod
(ShippingMethodResourceIdentifier shippingMethod) Shipping Method for the Cart.shippingMethod
(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifierBuilder> builder) Shipping Method for the Cart.shippingMode
(ShippingMode shippingMode) If set toSingle
, only a single Shipping Method can be added to the Cart. If set toMultiple
, multiple Shipping Methods can be added to the Cart.store
(StoreResourceIdentifier store) ResourceIdentifier to the Store the Cart should belong to.ResourceIdentifier to the Store the Cart should belong to.Determines how Tax Rates are set.Billing address associated with the Cart.withBusinessUnit
(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) ResourceIdentifier to the Business Unit the Cart should belong to.Custom Fields for the Cart.Multiple shipping addresses of the Cart.Line Items to add to the Cart.Shipping address associated with the Cart.withShippingMethod
(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifier> builder) Shipping Method for the Cart.ResourceIdentifier to the Store the Cart should belong to.
-
Constructor Details
-
MyCartDraftBuilder
public MyCartDraftBuilder()
-
-
Method Details
-
currency
Currency the Cart uses.
- Parameters:
currency
- value to be set- Returns:
- Builder
-
customerEmail
Email address of the Customer the Cart belongs to.
- Parameters:
customerEmail
- value to be set- Returns:
- Builder
-
businessUnit
public MyCartDraftBuilder businessUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifierBuilder> builder) ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
withBusinessUnit
public MyCartDraftBuilder withBusinessUnit(Function<BusinessUnitResourceIdentifierBuilder, BusinessUnitResourceIdentifier> builder) ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
businessUnit
ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.
- Parameters:
businessUnit
- value to be set- Returns:
- Builder
-
store
public MyCartDraftBuilder store(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifierBuilder> builder) ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.
- Parameters:
builder
- function to build the store value- Returns:
- Builder
-
withStore
public MyCartDraftBuilder withStore(Function<StoreResourceIdentifierBuilder, StoreResourceIdentifier> builder) ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.
- Parameters:
builder
- function to build the store value- Returns:
- Builder
-
store
ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.
- Parameters:
store
- value to be set- Returns:
- Builder
-
lineItems
Line Items to add to the Cart.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
lineItems
Line Items to add to the Cart.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
plusLineItems
Line Items to add to the Cart.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
plusLineItems
public MyCartDraftBuilder plusLineItems(Function<MyLineItemDraftBuilder, MyLineItemDraftBuilder> builder) Line Items to add to the Cart.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
withLineItems
public MyCartDraftBuilder withLineItems(Function<MyLineItemDraftBuilder, MyLineItemDraftBuilder> builder) Line Items to add to the Cart.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
addLineItems
Line Items to add to the Cart.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
setLineItems
Line Items to add to the Cart.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
taxMode
Determines how Tax Rates are set. The
Disabled
TaxMode cannot be set.- Parameters:
taxMode
- value to be set- Returns:
- Builder
-
inventoryMode
Determines how stock quantities are tracked for Line Items in the Cart.
- Parameters:
inventoryMode
- value to be set- Returns:
- Builder
-
billingAddress
Billing address associated with the Cart.
- Parameters:
builder
- function to build the billingAddress value- Returns:
- Builder
-
withBillingAddress
Billing address associated with the Cart.
- Parameters:
builder
- function to build the billingAddress value- Returns:
- Builder
-
billingAddress
Billing address associated with the Cart.
- Parameters:
billingAddress
- value to be set- Returns:
- Builder
-
shippingAddress
Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.
- Parameters:
builder
- function to build the shippingAddress value- Returns:
- Builder
-
withShippingAddress
Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.
- Parameters:
builder
- function to build the shippingAddress value- Returns:
- Builder
-
shippingAddress
Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.
- Parameters:
shippingAddress
- value to be set- Returns:
- Builder
-
shippingMethod
public MyCartDraftBuilder shippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifierBuilder> builder) Shipping Method for the Cart. If the referenced ShippingMethod has a
predicate
that does not match the Cart, an InvalidOperation error is returned when creating a Cart.- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
withShippingMethod
public MyCartDraftBuilder withShippingMethod(Function<ShippingMethodResourceIdentifierBuilder, ShippingMethodResourceIdentifier> builder) Shipping Method for the Cart. If the referenced ShippingMethod has a
predicate
that does not match the Cart, an InvalidOperation error is returned when creating a Cart.- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
shippingMethod
Shipping Method for the Cart. If the referenced ShippingMethod has a
predicate
that does not match the Cart, an InvalidOperation error is returned when creating a Cart.- Parameters:
shippingMethod
- value to be set- Returns:
- Builder
-
itemShippingAddresses
Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
itemShippingAddresses
- value to be set- Returns:
- Builder
-
itemShippingAddresses
Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
itemShippingAddresses
- value to be set- Returns:
- Builder
-
plusItemShippingAddresses
Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
itemShippingAddresses
- value to be set- Returns:
- Builder
-
plusItemShippingAddresses
public MyCartDraftBuilder plusItemShippingAddresses(Function<BaseAddressBuilder, BaseAddressBuilder> builder) Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
builder
- function to build the itemShippingAddresses value- Returns:
- Builder
-
withItemShippingAddresses
public MyCartDraftBuilder withItemShippingAddresses(Function<BaseAddressBuilder, BaseAddressBuilder> builder) Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
builder
- function to build the itemShippingAddresses value- Returns:
- Builder
-
addItemShippingAddresses
public MyCartDraftBuilder addItemShippingAddresses(Function<BaseAddressBuilder, BaseAddress> builder) Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
builder
- function to build the itemShippingAddresses value- Returns:
- Builder
-
setItemShippingAddresses
public MyCartDraftBuilder setItemShippingAddresses(Function<BaseAddressBuilder, BaseAddress> builder) Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Parameters:
builder
- function to build the itemShippingAddresses value- Returns:
- Builder
-
shippingMode
- If set to
Single
, only a single Shipping Method can be added to the Cart. - If set to
Multiple
, multiple Shipping Methods can be added to the Cart.
- Parameters:
shippingMode
- value to be set- Returns:
- Builder
- If set to
-
discountCodes
code
of the existing DiscountCodes to add to the Cart.- Parameters:
discountCodes
- value to be set- Returns:
- Builder
-
discountCodes
code
of the existing DiscountCodes to add to the Cart.- Parameters:
discountCodes
- value to be set- Returns:
- Builder
-
plusDiscountCodes
code
of the existing DiscountCodes to add to the Cart.- Parameters:
discountCodes
- value to be set- Returns:
- Builder
-
country
Used for Line Item price selection. If used for Create Cart in Store, the provided country must be one of the Store's
countries
.- Parameters:
country
- value to be set- Returns:
- Builder
-
locale
Languages of the Cart. Can only contain languages supported by the Project.
- Parameters:
locale
- value to be set- Returns:
- Builder
-
deleteDaysAfterLastModification
public MyCartDraftBuilder deleteDaysAfterLastModification(@Nullable Long deleteDaysAfterLastModification) Number of days after which a Cart with
Active
CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.
- Parameters:
deleteDaysAfterLastModification
- value to be set- Returns:
- Builder
-
custom
public MyCartDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the Cart.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Cart.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Cart.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getCurrency
Currency the Cart uses.
- Returns:
- currency
-
getCustomerEmail
Email address of the Customer the Cart belongs to.
- Returns:
- customerEmail
-
getBusinessUnit
ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.
- Returns:
- businessUnit
-
getStore
ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.
- Returns:
- store
-
getLineItems
Line Items to add to the Cart.
- Returns:
- lineItems
-
getTaxMode
Determines how Tax Rates are set. The
Disabled
TaxMode cannot be set.- Returns:
- taxMode
-
getInventoryMode
Determines how stock quantities are tracked for Line Items in the Cart.
- Returns:
- inventoryMode
-
getBillingAddress
Billing address associated with the Cart.
- Returns:
- billingAddress
-
getShippingAddress
Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.
- Returns:
- shippingAddress
-
getShippingMethod
Shipping Method for the Cart. If the referenced ShippingMethod has a
predicate
that does not match the Cart, an InvalidOperation error is returned when creating a Cart.- Returns:
- shippingMethod
-
getItemShippingAddresses
Multiple shipping addresses of the Cart. Each address must contain a
key
that is unique in this Cart. The keys are used by LineItems to reference these addresses under theirshippingDetails
.Eligible Shipping Methods or applicable Tax Rates are determined by the Cart
shippingAddress
, and notitemShippingAddresses
.- Returns:
- itemShippingAddresses
-
getShippingMode
- If set to
Single
, only a single Shipping Method can be added to the Cart. - If set to
Multiple
, multiple Shipping Methods can be added to the Cart.
- Returns:
- shippingMode
- If set to
-
getDiscountCodes
code
of the existing DiscountCodes to add to the Cart.- Returns:
- discountCodes
-
getCountry
Used for Line Item price selection. If used for Create Cart in Store, the provided country must be one of the Store's
countries
.- Returns:
- country
-
getLocale
Languages of the Cart. Can only contain languages supported by the Project.
- Returns:
- locale
-
getDeleteDaysAfterLastModification
Number of days after which a Cart with
Active
CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.
- Returns:
- deleteDaysAfterLastModification
-
getCustom
Custom Fields for the Cart.
- Returns:
- custom
-
build
builds MyCartDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<MyCartDraft>
- Returns:
- MyCartDraft
-
buildUnchecked
builds MyCartDraft without checking for non-null required values- Returns:
- MyCartDraft
-
of
factory method for an instance of MyCartDraftBuilder- Returns:
- builder
-
of
create builder for MyCartDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-