Interface ShoppingListLineItem
- All Superinterfaces:
Customizable<ShoppingListLineItem>
ShoppingListLineItems are Line Items that contain references to ProductVariants in a Product.
In addition to standard Reference Expansion, a ShoppingListLineItem offers expansion on productSlug and variant, defined with the query parameter expand.
Example to create an instance using the builder pattern
ShoppingListLineItem shoppingListLineItem = ShoppingListLineItem.builder()
.addedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.id("{id}")
.name(nameBuilder -> nameBuilder)
.productId("{productId}")
.productType(productTypeBuilder -> productTypeBuilder)
.published(true)
.quantity(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShoppingListLineItemBuilderbuilder()builder factory method for ShoppingListLineItemstatic ShoppingListLineItemBuilderbuilder(ShoppingListLineItem template) create builder for ShoppingListLineItem instancecopyDeep()static ShoppingListLineItemdeepCopy(ShoppingListLineItem template) factory method to create a deep copy of ShoppingListLineItem@NotNull ZonedDateTimeDate and time (UTC) the ShoppingListLineItem was added to the ShoppingList.@Valid CustomFieldsCustom Fields of the ShoppingListLineItem.If the Product or Product Variant is deleted,deactivatedAtis the date and time (UTC) of deletion.@NotNull StringgetId()Unique identifier of the ShoppingListLineItem.getKey()User-defined identifier of the ShoppingListLineItem.@NotNull @Valid LocalizedStringgetName()Name of the Product.@NotNull StringUnique identifier of a Product.@Valid LocalizedStringSlug of the current ProductData.@NotNull @Valid ProductTypeReferenceThe Product Type defining the Attributes of the Product.@NotNull BooleanWhether the related Product is published or not.@NotNull LongNumber of Products in the ShoppingListLineItem.@Valid ProductVariantData of the ProductVariant.idof the ProductVariant the ShoppingListLineItem refers to.static ShoppingListLineItemof()factory methodstatic ShoppingListLineItemof(ShoppingListLineItem template) factory method to create a shallow copy ShoppingListLineItemvoidsetAddedAt(ZonedDateTime addedAt) Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.voidsetCustom(CustomFields custom) Custom Fields of the ShoppingListLineItem.voidsetDeactivatedAt(ZonedDateTime deactivatedAt) If the Product or Product Variant is deleted,deactivatedAtis the date and time (UTC) of deletion.voidUnique identifier of the ShoppingListLineItem.voidUser-defined identifier of the ShoppingListLineItem.voidsetName(LocalizedString name) Name of the Product.voidsetProductId(String productId) Unique identifier of a Product.voidsetProductSlug(LocalizedString productSlug) Slug of the current ProductData.voidsetProductType(ProductTypeReference productType) The Product Type defining the Attributes of the Product.voidsetPublished(Boolean published) Whether the related Product is published or not.voidsetQuantity(Long quantity) Number of Products in the ShoppingListLineItem.voidsetVariant(ProductVariant variant) Data of the ProductVariant.voidsetVariantId(Long variantId) idof the ProductVariant the ShoppingListLineItem refers to.static com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItem>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithShoppingListLineItem(Function<ShoppingListLineItem, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
-
Method Details
-
getAddedAt
Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.
- Returns:
- addedAt
-
getCustom
Custom Fields of the ShoppingListLineItem.
- Specified by:
getCustomin interfaceCustomizable<ShoppingListLineItem>- Returns:
- custom
-
getDeactivatedAt
ZonedDateTime getDeactivatedAt()If the Product or Product Variant is deleted,
deactivatedAtis the date and time (UTC) of deletion.This data is updated in an eventual consistent manner when the Product Variant cannot be ordered anymore.
- Returns:
- deactivatedAt
-
getId
Unique identifier of the ShoppingListLineItem.
- Returns:
- id
-
getKey
String getKey()User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.
- Returns:
- key
-
getName
Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Returns:
- name
-
getProductId
Unique identifier of a Product.
- Returns:
- productId
-
getProductType
The Product Type defining the Attributes of the Product.
- Returns:
- productType
-
getPublished
Whether the related Product is published or not.
This data is updated in an eventual consistent manner when the Product's published status changes.
- Returns:
- published
-
getQuantity
Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
getVariantId
Long getVariantId()idof the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.- Returns:
- variantId
-
getVariant
Data of the ProductVariant. This data includes all the Product Attributes and Variant Attributes to ensure the full Attribute context of the Product Variant.
Returned when expanded using
expand=lineItems[*].variant. You cannot expand only a single element of the array.- Returns:
- variant
-
getProductSlug
Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug. You cannot expand only a single element of the array.- Returns:
- productSlug
-
setAddedAt
Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.
- Parameters:
addedAt- value to be set
-
setCustom
Custom Fields of the ShoppingListLineItem.
- Specified by:
setCustomin interfaceCustomizable<ShoppingListLineItem>- Parameters:
custom- value to be set
-
setDeactivatedAt
If the Product or Product Variant is deleted,
deactivatedAtis the date and time (UTC) of deletion.This data is updated in an eventual consistent manner when the Product Variant cannot be ordered anymore.
- Parameters:
deactivatedAt- value to be set
-
setId
Unique identifier of the ShoppingListLineItem.
- Parameters:
id- value to be set
-
setKey
User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.
- Parameters:
key- value to be set
-
setName
Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Parameters:
name- value to be set
-
setProductId
Unique identifier of a Product.
- Parameters:
productId- value to be set
-
setProductType
The Product Type defining the Attributes of the Product.
- Parameters:
productType- value to be set
-
setPublished
Whether the related Product is published or not.
This data is updated in an eventual consistent manner when the Product's published status changes.
- Parameters:
published- value to be set
-
setQuantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity- value to be set
-
setVariantId
idof the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.- Parameters:
variantId- value to be set
-
setVariant
Data of the ProductVariant. This data includes all the Product Attributes and Variant Attributes to ensure the full Attribute context of the Product Variant.
Returned when expanded using
expand=lineItems[*].variant. You cannot expand only a single element of the array.- Parameters:
variant- value to be set
-
setProductSlug
Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug. You cannot expand only a single element of the array.- Parameters:
productSlug- value to be set
-
of
factory method- Returns:
- instance of ShoppingListLineItem
-
of
factory method to create a shallow copy ShoppingListLineItem- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ShoppingListLineItem copyDeep() -
deepCopy
factory method to create a deep copy of ShoppingListLineItem- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShoppingListLineItem- Returns:
- builder
-
builder
create builder for ShoppingListLineItem instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withShoppingListLineItem
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
-