Interface MyShoppingListDraft
- All Superinterfaces:
CustomizableDraft<MyShoppingListDraft>,Draft<MyShoppingListDraft>
A MyShoppingListDraft is the object submitted as payload to the Create MyShoppingList request. The customer field of ShoppingList is automatically set with a password flow token. The anonymousId is automatically set with a token for an anonymous session. The key and slug fields can not be set.
Example to create an instance using the builder pattern
MyShoppingListDraft myShoppingListDraft = MyShoppingListDraft.builder()
.name(nameBuilder -> nameBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MyShoppingListDraftBuilderbuilder()builder factory method for MyShoppingListDraftstatic MyShoppingListDraftBuilderbuilder(MyShoppingListDraft template) create builder for MyShoppingListDraft instancecopyDeep()static MyShoppingListDraftdeepCopy(MyShoppingListDraft template) factory method to create a deep copy of MyShoppingListDraft@Valid CustomFieldsDraftCustom Fields defined for the ShoppingList.Number of days after the last modification before a ShoppingList is deleted.@Valid LocalizedStringDescription of the ShoppingList.@Valid List<ShoppingListLineItemDraft>Line Items (containing Products) to add to the ShoppingList.@NotNull @Valid LocalizedStringgetName()Name of the ShoppingList.@Valid StoreResourceIdentifiergetStore()Assigns the new ShoppingList to the Store.@Valid List<TextLineItemDraft>Line Items (containing text values) to add to the ShoppingList.static MyShoppingListDraftof()factory methodstatic MyShoppingListDraftof(MyShoppingListDraft template) factory method to create a shallow copy MyShoppingListDraftvoidsetCustom(CustomFieldsDraft custom) Custom Fields defined for the ShoppingList.voidsetDeleteDaysAfterLastModification(Long deleteDaysAfterLastModification) Number of days after the last modification before a ShoppingList is deleted.voidsetDescription(LocalizedString description) Description of the ShoppingList.voidsetLineItems(ShoppingListLineItemDraft... lineItems) Line Items (containing Products) to add to the ShoppingList.voidsetLineItems(List<ShoppingListLineItemDraft> lineItems) Line Items (containing Products) to add to the ShoppingList.voidsetName(LocalizedString name) Name of the ShoppingList.voidsetStore(StoreResourceIdentifier store) Assigns the new ShoppingList to the Store.voidsetTextLineItems(TextLineItemDraft... textLineItems) Line Items (containing text values) to add to the ShoppingList.voidsetTextLineItems(List<TextLineItemDraft> textLineItems) Line Items (containing text values) to add to the ShoppingList.static com.fasterxml.jackson.core.type.TypeReference<MyShoppingListDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithMyShoppingListDraft(Function<MyShoppingListDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getName
Name of the ShoppingList.
- Returns:
- name
-
getDescription
Description of the ShoppingList.
- Returns:
- description
-
getLineItems
Line Items (containing Products) to add to the ShoppingList.
- Returns:
- lineItems
-
getTextLineItems
Line Items (containing text values) to add to the ShoppingList.
- Returns:
- textLineItems
-
getCustom
Custom Fields defined for the ShoppingList.
- Specified by:
getCustomin interfaceCustomizableDraft<MyShoppingListDraft>- Returns:
- custom
-
getDeleteDaysAfterLastModification
Long getDeleteDaysAfterLastModification()Number of days after the last modification before a ShoppingList is deleted. If not set, the default value configured in the Project is used.
- Returns:
- deleteDaysAfterLastModification
-
getStore
Assigns the new ShoppingList to the Store. The Store assignment can not be modified.
- Returns:
- store
-
setName
Name of the ShoppingList.
- Parameters:
name- value to be set
-
setDescription
Description of the ShoppingList.
- Parameters:
description- value to be set
-
setLineItems
Line Items (containing Products) to add to the ShoppingList.
- Parameters:
lineItems- values to be set
-
setLineItems
Line Items (containing Products) to add to the ShoppingList.
- Parameters:
lineItems- values to be set
-
setTextLineItems
Line Items (containing text values) to add to the ShoppingList.
- Parameters:
textLineItems- values to be set
-
setTextLineItems
Line Items (containing text values) to add to the ShoppingList.
- Parameters:
textLineItems- values to be set
-
setCustom
Custom Fields defined for the ShoppingList.
- Specified by:
setCustomin interfaceCustomizableDraft<MyShoppingListDraft>- Parameters:
custom- value to be set
-
setDeleteDaysAfterLastModification
Number of days after the last modification before a ShoppingList is deleted. If not set, the default value configured in the Project is used.
- Parameters:
deleteDaysAfterLastModification- value to be set
-
setStore
Assigns the new ShoppingList to the Store. The Store assignment can not be modified.
- Parameters:
store- value to be set
-
of
factory method- Returns:
- instance of MyShoppingListDraft
-
of
factory method to create a shallow copy MyShoppingListDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
MyShoppingListDraft copyDeep() -
deepCopy
factory method to create a deep copy of MyShoppingListDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MyShoppingListDraft- Returns:
- builder
-
builder
create builder for MyShoppingListDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withMyShoppingListDraft
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
-