Class MergeCartDraftBuilder
- All Implemented Interfaces:
Builder<MergeCartDraft>
Example to create an instance using the builder pattern
MergeCartDraft mergeCartDraft = MergeCartDraft.builder()
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanonymousCart(CartResourceIdentifier anonymousCart) ResourceIdentifier to the anonymous Cart to be merged.ResourceIdentifier to the anonymous Cart to be merged.anonymousId(String anonymousId) Assigns the Customer to the Carts that have the sameanonymousId.build()builds MergeCartDraft with checking for non-null required valuesbuilds MergeCartDraft without checking for non-null required valuesResourceIdentifier to the anonymous Cart to be merged.Assigns the Customer to the Carts that have the sameanonymousId.Determines how to merge the anonymous Cart with the existing Customer Cart.Iftrue, the LineItem Product data (name,variant, andproductType) of the returned Cart will be updated. Iffalse, only the prices, discounts, and tax rates will be updated.mergeMode(CartMergeMode mergeMode) Determines how to merge the anonymous Cart with the existing Customer Cart.static MergeCartDraftBuilderof()factory method for an instance of MergeCartDraftBuilderstatic MergeCartDraftBuilderof(MergeCartDraft template) create builder for MergeCartDraft instanceupdateProductData(Boolean updateProductData) Iftrue, the LineItem Product data (name,variant, andproductType) of the returned Cart will be updated. Iffalse, only the prices, discounts, and tax rates will be updated.ResourceIdentifier to the anonymous Cart to be merged.
-
Constructor Details
-
MergeCartDraftBuilder
public MergeCartDraftBuilder()
-
-
Method Details
-
anonymousCart
public MergeCartDraftBuilder anonymousCart(Function<CartResourceIdentifierBuilder, CartResourceIdentifierBuilder> builder) ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Parameters:
builder- function to build the anonymousCart value- Returns:
- Builder
-
withAnonymousCart
public MergeCartDraftBuilder withAnonymousCart(Function<CartResourceIdentifierBuilder, CartResourceIdentifier> builder) ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Parameters:
builder- function to build the anonymousCart value- Returns:
- Builder
-
anonymousCart
ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Parameters:
anonymousCart- value to be set- Returns:
- Builder
-
mergeMode
Determines how to merge the anonymous Cart with the existing Customer Cart.
- Parameters:
mergeMode- value to be set- Returns:
- Builder
-
updateProductData
- If
true, the LineItem Product data (name,variant, andproductType) of the returned Cart will be updated. - If
false, only the prices, discounts, and tax rates will be updated.
- Parameters:
updateProductData- value to be set- Returns:
- Builder
- If
-
anonymousId
Assigns the Customer to the Carts that have the same
anonymousId. Required ifanonymousCartis not provided. If bothanonymousCartandanonymousIdare provided, this value must match theanonymousIdof the anonymous Cart otherwise, an InvalidOperation error is returned.- Parameters:
anonymousId- value to be set- Returns:
- Builder
-
getAnonymousCart
ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Returns:
- anonymousCart
-
getMergeMode
Determines how to merge the anonymous Cart with the existing Customer Cart.
- Returns:
- mergeMode
-
getUpdateProductData
- If
true, the LineItem Product data (name,variant, andproductType) of the returned Cart will be updated. - If
false, only the prices, discounts, and tax rates will be updated.
- Returns:
- updateProductData
- If
-
getAnonymousId
Assigns the Customer to the Carts that have the same
anonymousId. Required ifanonymousCartis not provided. If bothanonymousCartandanonymousIdare provided, this value must match theanonymousIdof the anonymous Cart otherwise, an InvalidOperation error is returned.- Returns:
- anonymousId
-
build
builds MergeCartDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<MergeCartDraft>- Returns:
- MergeCartDraft
-
buildUnchecked
builds MergeCartDraft without checking for non-null required values- Returns:
- MergeCartDraft
-
of
factory method for an instance of MergeCartDraftBuilder- Returns:
- builder
-
of
create builder for MergeCartDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-