Interface ShoppingListLineItem

All Superinterfaces:
Customizable<ShoppingListLineItem>

public interface ShoppingListLineItem extends 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 Details

    • getAddedAt

      @NotNull @NotNull ZonedDateTime getAddedAt()

      Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.

      Returns:
      addedAt
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields of the ShoppingListLineItem.

      Specified by:
      getCustom in interface Customizable<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

      @NotNull @NotNull String 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

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Product.

      This data is updated in an eventual consistent manner when the Product's name changes.

      Returns:
      name
    • getProductId

      @NotNull @NotNull String getProductId()

      Unique identifier of a Product.

      Returns:
      productId
    • getProductType

      @NotNull @Valid @NotNull @Valid ProductTypeReference getProductType()

      The Product Type defining the Attributes of the Product.

      Returns:
      productType
    • getQuantity

      @NotNull @NotNull Long 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

      @Valid @Valid ProductVariant 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

      @Valid @Valid LocalizedString 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

      void setAddedAt(ZonedDateTime addedAt)

      Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.

      Parameters:
      addedAt - value to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields of the ShoppingListLineItem.

      Specified by:
      setCustom in interface Customizable<ShoppingListLineItem>
      Parameters:
      custom - value to be set
    • setDeactivatedAt

      void setDeactivatedAt(ZonedDateTime deactivatedAt)

      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

      void setId(String id)

      Unique identifier of the ShoppingListLineItem.

      Parameters:
      id - value to be set
    • setKey

      void setKey(String key)

      User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.

      Parameters:
      key - value to be set
    • setName

      void setName(LocalizedString name)

      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

      void setProductId(String productId)

      Unique identifier of a Product.

      Parameters:
      productId - value to be set
    • setProductType

      void setProductType(ProductTypeReference productType)

      The Product Type defining the Attributes of the Product.

      Parameters:
      productType - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      Number of Products in the ShoppingListLineItem.

      Parameters:
      quantity - value to be set
    • setVariantId

      void setVariantId(Long variantId)

      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

      void setVariant(ProductVariant variant)

      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

      void setProductSlug(LocalizedString productSlug)

      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

      static ShoppingListLineItem 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

      static ShoppingListLineItemBuilder 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

      default <T> T withShoppingListLineItem(Function<ShoppingListLineItem,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItem> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference