Interface MergeCartDraft
- All Superinterfaces:
Draft<MergeCartDraft>
Used for merging an anonymous Cart with a Customer Cart with the Merge Cart and Merge Cart in Store endpoints. Either anonymousCart or anonymousId is required.
Example to create an instance using the builder pattern
MergeCartDraft mergeCartDraft = MergeCartDraft.builder()
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MergeCartDraftBuilderbuilder()builder factory method for MergeCartDraftstatic MergeCartDraftBuilderbuilder(MergeCartDraft template) create builder for MergeCartDraft instancecopyDeep()static MergeCartDraftdeepCopy(MergeCartDraft template) factory method to create a deep copy of MergeCartDraft@Valid CartResourceIdentifierResourceIdentifier 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.static MergeCartDraftof()factory methodstatic MergeCartDraftof(MergeCartDraft template) factory method to create a shallow copy MergeCartDraftvoidsetAnonymousCart(CartResourceIdentifier anonymousCart) ResourceIdentifier to the anonymous Cart to be merged.voidsetAnonymousId(String anonymousId) Assigns the Customer to the Carts that have the sameanonymousId.voidsetMergeMode(CartMergeMode mergeMode) Determines how to merge the anonymous Cart with the existing Customer Cart.voidsetUpdateProductData(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.static com.fasterxml.jackson.core.type.TypeReference<MergeCartDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithMergeCartDraft(Function<MergeCartDraft, T> helper) accessor map function
-
Method Details
-
getAnonymousCart
ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Returns:
- anonymousCart
-
getMergeMode
CartMergeMode getMergeMode()Determines how to merge the anonymous Cart with the existing Customer Cart.
- Returns:
- mergeMode
-
getUpdateProductData
Boolean 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
String 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
-
setAnonymousCart
ResourceIdentifier to the anonymous Cart to be merged. Required if
anonymousIdis not provided.- Parameters:
anonymousCart- value to be set
-
setMergeMode
Determines how to merge the anonymous Cart with the existing Customer Cart.
- Parameters:
mergeMode- value to be set
-
setUpdateProductData
- 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
- If
-
setAnonymousId
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
-
of
factory method- Returns:
- instance of MergeCartDraft
-
of
factory method to create a shallow copy MergeCartDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
MergeCartDraft copyDeep() -
deepCopy
factory method to create a deep copy of MergeCartDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MergeCartDraft- Returns:
- builder
-
builder
create builder for MergeCartDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withMergeCartDraft
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
-