Interface MyLineItemDraft

All Superinterfaces:
CustomizableDraft<MyLineItemDraft>, Draft<MyLineItemDraft>

public interface MyLineItemDraft extends CustomizableDraft<MyLineItemDraft>, Draft<MyLineItemDraft>

For Product Variant identification, either the productId and variantId, or sku must be provided.


Example to create an instance using the builder pattern

     MyLineItemDraft myLineItemDraft = MyLineItemDraft.builder()
             .build()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier of the LineItem.

      Returns:
      key
    • getProductId

      String getProductId()

      id of the Product.

      Returns:
      productId
    • getVariantId

      Long getVariantId()

      id of the ProductVariant in the Product. If not provided, the Master Variant is used.

      Returns:
      variantId
    • getSku

      String getSku()

      sku of the ProductVariant.

      Returns:
      sku
    • getQuantity

      Long getQuantity()

      Number of Product Variants to add to the Cart.

      Returns:
      quantity
    • getAddedAt

      ZonedDateTime getAddedAt()

      Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.

      Optional for backwards compatibility reasons.

      Returns:
      addedAt
    • getSupplyChannel

      @Valid @Valid ChannelResourceIdentifier getSupplyChannel()

      Used to identify Inventory entries that must be reserved. The Channel must have the InventorySupply ChannelRoleEnum.

      Returns:
      supplyChannel
    • getDistributionChannel

      @Valid @Valid ChannelResourceIdentifier getDistributionChannel()

      Used to select a Product Price. The Channel must have the ProductDistribution ChannelRoleEnum.

      If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

      Returns:
      distributionChannel
    • getShippingDetails

      @Valid @Valid ItemShippingDetailsDraft getShippingDetails()

      Container for Line Item-specific addresses.

      Returns:
      shippingDetails
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the Cart.

      Specified by:
      getCustom in interface CustomizableDraft<MyLineItemDraft>
      Returns:
      custom
    • setKey

      void setKey(String key)

      User-defined unique identifier of the LineItem.

      Parameters:
      key - value to be set
    • setProductId

      void setProductId(String productId)

      id of the Product.

      Parameters:
      productId - value to be set
    • setVariantId

      void setVariantId(Long variantId)

      id of the ProductVariant in the Product. If not provided, the Master Variant is used.

      Parameters:
      variantId - value to be set
    • setSku

      void setSku(String sku)

      sku of the ProductVariant.

      Parameters:
      sku - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      Number of Product Variants to add to the Cart.

      Parameters:
      quantity - value to be set
    • setAddedAt

      void setAddedAt(ZonedDateTime addedAt)

      Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.

      Optional for backwards compatibility reasons.

      Parameters:
      addedAt - value to be set
    • setSupplyChannel

      void setSupplyChannel(ChannelResourceIdentifier supplyChannel)

      Used to identify Inventory entries that must be reserved. The Channel must have the InventorySupply ChannelRoleEnum.

      Parameters:
      supplyChannel - value to be set
    • setDistributionChannel

      void setDistributionChannel(ChannelResourceIdentifier distributionChannel)

      Used to select a Product Price. The Channel must have the ProductDistribution ChannelRoleEnum.

      If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

      Parameters:
      distributionChannel - value to be set
    • setShippingDetails

      void setShippingDetails(ItemShippingDetailsDraft shippingDetails)

      Container for Line Item-specific addresses.

      Parameters:
      shippingDetails - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for the Cart.

      Specified by:
      setCustom in interface CustomizableDraft<MyLineItemDraft>
      Parameters:
      custom - value to be set
    • of

      static MyLineItemDraft of()
      factory method
      Returns:
      instance of MyLineItemDraft
    • of

      static MyLineItemDraft of(MyLineItemDraft template)
      factory method to create a shallow copy MyLineItemDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static MyLineItemDraft deepCopy(@Nullable MyLineItemDraft template)
      factory method to create a deep copy of MyLineItemDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static MyLineItemDraftBuilder builder()
      builder factory method for MyLineItemDraft
      Returns:
      builder
    • builder

      static MyLineItemDraftBuilder builder(MyLineItemDraft template)
      create builder for MyLineItemDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMyLineItemDraft

      default <T> T withMyLineItemDraft(Function<MyLineItemDraft,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<MyLineItemDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference