Interface CartDiscountValueGiftLineItem

All Superinterfaces:
CartDiscountValue, CartDiscountValueGiftLineItemMixin, CartDiscountValueMixin, GenericCartDiscountValueMixin<CartDiscountValueGiftLineItemDraft>

public interface CartDiscountValueGiftLineItem extends CartDiscountValue, CartDiscountValueGiftLineItemMixin
CartDiscountValueGiftLineItem
Example to create an instance using the builder pattern

     CartDiscountValueGiftLineItem cartDiscountValueGiftLineItem = CartDiscountValueGiftLineItem.builder()
             .product(productBuilder -> productBuilder)
             .variantId(0.3)
             .build()
 
  • Field Details

    • GIFT_LINE_ITEM

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

    • getProduct

      @NotNull @Valid @NotNull @Valid ProductReference getProduct()

      Reference to a Product.

      A Gift Line Item can be present on a Cart even if the referenced Product is unpublished.

      Specified by:
      getProduct in interface CartDiscountValueGiftLineItemMixin
      Returns:
      product
    • getVariantId

      @NotNull @NotNull Long getVariantId()

      ProductVariant of the Product.

      Specified by:
      getVariantId in interface CartDiscountValueGiftLineItemMixin
      Returns:
      variantId
    • getSupplyChannel

      @Valid @Valid ChannelReference getSupplyChannel()

      Channel must have the ChannelRoleEnum InventorySupply.

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

      @Valid @Valid ChannelReference getDistributionChannel()

      Channel must have the ChannelRoleEnum ProductDistribution.

      Specified by:
      getDistributionChannel in interface CartDiscountValueGiftLineItemMixin
      Returns:
      distributionChannel
    • setProduct

      void setProduct(ProductReference product)

      Reference to a Product.

      A Gift Line Item can be present on 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(ChannelReference supplyChannel)

      Channel must have the ChannelRoleEnum InventorySupply.

      Parameters:
      supplyChannel - value to be set
    • setDistributionChannel

      void setDistributionChannel(ChannelReference distributionChannel)

      Channel must have the ChannelRoleEnum ProductDistribution.

      Parameters:
      distributionChannel - value to be set
    • of

      factory method
      Returns:
      instance of CartDiscountValueGiftLineItem
    • of

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

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

      builder factory method for CartDiscountValueGiftLineItem
      Returns:
      builder
    • builder

      create builder for CartDiscountValueGiftLineItem instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartDiscountValueGiftLineItem

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