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)
.quantity(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShoppingListLineItemBuilder
builder()
builder factory method for ShoppingListLineItemstatic ShoppingListLineItemBuilder
builder
(ShoppingListLineItem template) create builder for ShoppingListLineItem instancestatic ShoppingListLineItem
deepCopy
(ShoppingListLineItem template) factory method to create a deep copy of ShoppingListLineItem@NotNull ZonedDateTime
Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.@Valid CustomFields
Custom Fields of the ShoppingListLineItem.If the Product or Product Variant is deleted,deactivatedAt
is the date and time (UTC) of deletion.@NotNull String
getId()
Unique identifier of the ShoppingListLineItem.getKey()
User-defined identifier of the ShoppingListLineItem.@NotNull @Valid LocalizedString
getName()
Name of the Product.@NotNull String
Unique identifier of a Product.@Valid LocalizedString
Slug of the current ProductData.@NotNull @Valid ProductTypeReference
The Product Type defining the Attributes of the Product.@NotNull Long
Number of Products in the ShoppingListLineItem.@Valid ProductVariant
Data of the ProductVariant.id
of the ProductVariant the ShoppingListLineItem refers to.static ShoppingListLineItem
of()
factory methodstatic ShoppingListLineItem
of
(ShoppingListLineItem template) factory method to create a shallow copy ShoppingListLineItemvoid
setAddedAt
(ZonedDateTime addedAt) Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.void
setCustom
(CustomFields custom) Custom Fields of the ShoppingListLineItem.void
setDeactivatedAt
(ZonedDateTime deactivatedAt) If the Product or Product Variant is deleted,deactivatedAt
is the date and time (UTC) of deletion.void
Unique identifier of the ShoppingListLineItem.void
User-defined identifier of the ShoppingListLineItem.void
setName
(LocalizedString name) Name of the Product.void
setProductId
(String productId) Unique identifier of a Product.void
setProductSlug
(LocalizedString productSlug) Slug of the current ProductData.void
setProductType
(ProductTypeReference productType) The Product Type defining the Attributes of the Product.void
setQuantity
(Long quantity) Number of Products in the ShoppingListLineItem.void
setVariant
(ProductVariant variant) Data of the ProductVariant.void
setVariantId
(Long variantId) id
of the ProductVariant the ShoppingListLineItem refers to.static com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItem>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withShoppingListLineItem
(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:
getCustom
in interfaceCustomizable<ShoppingListLineItem>
- Returns:
- custom
-
getDeactivatedAt
ZonedDateTime getDeactivatedAt()If the Product or Product Variant is deleted,
deactivatedAt
is 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
-
getQuantity
Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
getVariantId
Long getVariantId()id
of the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.- Returns:
- variantId
-
getVariant
Data of the ProductVariant.
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:
setCustom
in interfaceCustomizable<ShoppingListLineItem>
- Parameters:
custom
- value to be set
-
setDeactivatedAt
If the Product or Product Variant is deleted,
deactivatedAt
is 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
-
setQuantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity
- value to be set
-
setVariantId
id
of 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.
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
-
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
-