Interface CustomLineItemImportDraft

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

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

Custom Line Items contain generic user-defined items that are not linked to Products.


Example to create an instance using the builder pattern

     CustomLineItemImportDraft customLineItemImportDraft = CustomLineItemImportDraft.builder()
             .name(nameBuilder -> nameBuilder)
             .slug("{slug}")
             .quantity(0.3)
             .money(moneyBuilder -> moneyBuilder)
             .build()
 
  • Method Details

    • getName

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

      Name of the Custom Line Item.

      Returns:
      name
    • getKey

      String getKey()

      User-defined unique identifier of the Custom Line Item.

      Returns:
      key
    • getSlug

      @NotNull @NotNull String getSlug()

      User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

      Returns:
      slug
    • getQuantity

      @NotNull @NotNull Long getQuantity()

      The number of items in the Custom Line Item. Can be a negative value.

      Returns:
      quantity
    • getMoney

      @NotNull @Valid @NotNull @Valid Money getMoney()

      The cost of individual items in the Custom Line Item. The amount can be negative.

      Returns:
      money
    • getTaxRate

      @Valid @Valid TaxRate getTaxRate()

      The tax rate used to calculate the taxedPrice of the Order.

      Returns:
      taxRate
    • getTaxCategory

      @Valid @Valid TaxCategoryResourceIdentifier getTaxCategory()

      Include a value to associate a Tax Category with the Custom Line Item.

      Returns:
      taxCategory
    • getPriceMode

      CustomLineItemPriceMode getPriceMode()
      • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
      • If External, Cart Discounts are not considered on the Custom Line Item.
      Returns:
      priceMode
    • getShippingDetails

      @Valid @Valid ItemShippingDetailsDraft getShippingDetails()

      Container for Custom Line Item-specific addresses.

      Returns:
      shippingDetails
    • getState

      @Valid @Valid List<ItemState> getState()

      State of the Custom Line Items.

      Returns:
      state
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields of the CustomLineItem.

      Specified by:
      getCustom in interface CustomizableDraft<CustomLineItemImportDraft>
      Returns:
      custom
    • setName

      void setName(LocalizedString name)

      Name of the Custom Line Item.

      Parameters:
      name - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Custom Line Item.

      Parameters:
      key - value to be set
    • setSlug

      void setSlug(String slug)

      User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

      Parameters:
      slug - value to be set
    • setQuantity

      void setQuantity(Long quantity)

      The number of items in the Custom Line Item. Can be a negative value.

      Parameters:
      quantity - value to be set
    • setMoney

      void setMoney(Money money)

      The cost of individual items in the Custom Line Item. The amount can be negative.

      Parameters:
      money - value to be set
    • setTaxRate

      void setTaxRate(TaxRate taxRate)

      The tax rate used to calculate the taxedPrice of the Order.

      Parameters:
      taxRate - value to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryResourceIdentifier taxCategory)

      Include a value to associate a Tax Category with the Custom Line Item.

      Parameters:
      taxCategory - value to be set
    • setPriceMode

      void setPriceMode(CustomLineItemPriceMode priceMode)
      • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
      • If External, Cart Discounts are not considered on the Custom Line Item.
      Parameters:
      priceMode - value to be set
    • setShippingDetails

      void setShippingDetails(ItemShippingDetailsDraft shippingDetails)

      Container for Custom Line Item-specific addresses.

      Parameters:
      shippingDetails - value to be set
    • setState

      void setState(ItemState... state)

      State of the Custom Line Items.

      Parameters:
      state - values to be set
    • setState

      void setState(List<ItemState> state)

      State of the Custom Line Items.

      Parameters:
      state - values to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields of the CustomLineItem.

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

      factory method
      Returns:
      instance of CustomLineItemImportDraft
    • of

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

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

      builder factory method for CustomLineItemImportDraft
      Returns:
      builder
    • builder

      create builder for CustomLineItemImportDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCustomLineItemImportDraft

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