Interface CartDiscountValueGiftLineItemDraft

All Superinterfaces:
CartDiscountValueDraft, Draft<CartDiscountValueGiftLineItemDraft>

public interface CartDiscountValueGiftLineItemDraft extends CartDiscountValueDraft, Draft<CartDiscountValueGiftLineItemDraft>

Can only be used in a CartDiscountDraft with no target specified. Hence, this type can not be used in the Change Value update action.


Example to create an instance using the builder pattern

     CartDiscountValueGiftLineItemDraft cartDiscountValueGiftLineItemDraft = CartDiscountValueGiftLineItemDraft.builder()
             .product(productBuilder -> productBuilder)
             .variantId(0.3)
             .build()
 
  • Field Details

    • GIFT_LINE_ITEM

      static final String GIFT_LINE_ITEM
      discriminator value for CartDiscountValueGiftLineItemDraft
      See Also:
  • Method Details

    • getProduct

      @NotNull @Valid @NotNull @Valid ProductResourceIdentifier getProduct()

      ResourceIdentifier of a Product.

      A Gift Line Item is added to a Cart even if the referenced Product is unpublished.

      Returns:
      product
    • getVariantId

      @NotNull @NotNull Long getVariantId()

      ProductVariant of the Product.

      Returns:
      variantId
    • getSupplyChannel

      @Valid @Valid ChannelResourceIdentifier getSupplyChannel()

      Channel must have the role InventorySupply.

      Returns:
      supplyChannel
    • getDistributionChannel

      @Valid @Valid ChannelResourceIdentifier getDistributionChannel()

      Channel must have the role ProductDistribution.

      Returns:
      distributionChannel
    • setProduct

      void setProduct(ProductResourceIdentifier product)

      ResourceIdentifier of a Product.

      A Gift Line Item is added to a Cart even if the referenced Product is unpublished.

      Parameters:
      product - value to be set
    • setVariantId

      void setVariantId(Long variantId)

      ProductVariant of the Product.

      Parameters:
      variantId - value to be set
    • setSupplyChannel

      void setSupplyChannel(ChannelResourceIdentifier supplyChannel)

      Channel must have the role InventorySupply.

      Parameters:
      supplyChannel - value to be set
    • setDistributionChannel

      void setDistributionChannel(ChannelResourceIdentifier distributionChannel)

      Channel must have the role ProductDistribution.

      Parameters:
      distributionChannel - value to be set
    • of

      factory method
      Returns:
      instance of CartDiscountValueGiftLineItemDraft
    • of

      factory method to create a shallow copy CartDiscountValueGiftLineItemDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of CartDiscountValueGiftLineItemDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for CartDiscountValueGiftLineItemDraft
      Returns:
      builder
    • builder

      create builder for CartDiscountValueGiftLineItemDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartDiscountValueGiftLineItemDraft

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