Class MyLineItemDraftImpl

java.lang.Object
com.commercetools.api.models.me.MyLineItemDraftImpl
All Implemented Interfaces:
CustomizableDraft<MyLineItemDraft>, MyLineItemDraft, io.vrap.rmf.base.client.Draft<MyLineItemDraft>, io.vrap.rmf.base.client.ModelBase

public class MyLineItemDraftImpl extends Object implements MyLineItemDraft, io.vrap.rmf.base.client.ModelBase

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

  • Constructor Details

    • MyLineItemDraftImpl

      public MyLineItemDraftImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

      User-defined unique identifier of the LineItem.

      Specified by:
      getKey in interface MyLineItemDraft
      Returns:
      key
    • getProductId

      public String getProductId()

      id of the Product.

      Specified by:
      getProductId in interface MyLineItemDraft
      Returns:
      productId
    • getVariantId

      public Long getVariantId()

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

      Specified by:
      getVariantId in interface MyLineItemDraft
      Returns:
      variantId
    • getSku

      public String getSku()

      sku of the ProductVariant.

      Specified by:
      getSku in interface MyLineItemDraft
      Returns:
      sku
    • getQuantity

      public Long getQuantity()

      Number of Product Variants to add to the Cart.

      Specified by:
      getQuantity in interface MyLineItemDraft
      Returns:
      quantity
    • getAddedAt

      public 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.

      Specified by:
      getAddedAt in interface MyLineItemDraft
      Returns:
      addedAt
    • getSupplyChannel

      public ChannelResourceIdentifier getSupplyChannel()

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

      Specified by:
      getSupplyChannel in interface MyLineItemDraft
      Returns:
      supplyChannel
    • getDistributionChannel

      public 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.

      Specified by:
      getDistributionChannel in interface MyLineItemDraft
      Returns:
      distributionChannel
    • getShippingDetails

      public ItemShippingDetailsDraft getShippingDetails()

      Container for Line Item-specific addresses.

      Specified by:
      getShippingDetails in interface MyLineItemDraft
      Returns:
      shippingDetails
    • getCustom

      public CustomFieldsDraft getCustom()

      Custom Fields for the Cart.

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

      public void setKey(String key)
      Description copied from interface: MyLineItemDraft

      User-defined unique identifier of the LineItem.

      Specified by:
      setKey in interface MyLineItemDraft
      Parameters:
      key - value to be set
    • setProductId

      public void setProductId(String productId)
      Description copied from interface: MyLineItemDraft

      id of the Product.

      Specified by:
      setProductId in interface MyLineItemDraft
      Parameters:
      productId - value to be set
    • setVariantId

      public void setVariantId(Long variantId)
      Description copied from interface: MyLineItemDraft

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

      Specified by:
      setVariantId in interface MyLineItemDraft
      Parameters:
      variantId - value to be set
    • setSku

      public void setSku(String sku)
      Description copied from interface: MyLineItemDraft

      sku of the ProductVariant.

      Specified by:
      setSku in interface MyLineItemDraft
      Parameters:
      sku - value to be set
    • setQuantity

      public void setQuantity(Long quantity)
      Description copied from interface: MyLineItemDraft

      Number of Product Variants to add to the Cart.

      Specified by:
      setQuantity in interface MyLineItemDraft
      Parameters:
      quantity - value to be set
    • setAddedAt

      public void setAddedAt(ZonedDateTime addedAt)
      Description copied from interface: MyLineItemDraft

      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.

      Specified by:
      setAddedAt in interface MyLineItemDraft
      Parameters:
      addedAt - value to be set
    • setSupplyChannel

      public void setSupplyChannel(ChannelResourceIdentifier supplyChannel)
      Description copied from interface: MyLineItemDraft

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

      Specified by:
      setSupplyChannel in interface MyLineItemDraft
      Parameters:
      supplyChannel - value to be set
    • setDistributionChannel

      public void setDistributionChannel(ChannelResourceIdentifier distributionChannel)
      Description copied from interface: MyLineItemDraft

      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.

      Specified by:
      setDistributionChannel in interface MyLineItemDraft
      Parameters:
      distributionChannel - value to be set
    • setShippingDetails

      public void setShippingDetails(ItemShippingDetailsDraft shippingDetails)
      Description copied from interface: MyLineItemDraft

      Container for Line Item-specific addresses.

      Specified by:
      setShippingDetails in interface MyLineItemDraft
      Parameters:
      shippingDetails - value to be set
    • setCustom

      public void setCustom(CustomFieldsDraft custom)
      Description copied from interface: MyLineItemDraft

      Custom Fields for the Cart.

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object