Class StagedOrderAddLineItemActionBuilder

java.lang.Object
com.commercetools.api.models.order_edit.StagedOrderAddLineItemActionBuilder
All Implemented Interfaces:
Builder<StagedOrderAddLineItemAction>

public class StagedOrderAddLineItemActionBuilder extends Object implements Builder<StagedOrderAddLineItemAction>
StagedOrderAddLineItemActionBuilder
Example to create an instance using the builder pattern

     StagedOrderAddLineItemAction stagedOrderAddLineItemAction = StagedOrderAddLineItemAction.builder()
             .build()
 
  • Constructor Details

    • StagedOrderAddLineItemActionBuilder

      public StagedOrderAddLineItemActionBuilder()
  • Method Details

    • key

      public StagedOrderAddLineItemActionBuilder key(@Nullable String key)

      User-defined unique identifier of the LineItem.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • productId

      public StagedOrderAddLineItemActionBuilder productId(@Nullable String productId)

      id of the published Product.

      Either the productId and variantId, or sku must be provided.

      Parameters:
      productId - value to be set
      Returns:
      Builder
    • variantId

      public StagedOrderAddLineItemActionBuilder variantId(@Nullable Long variantId)

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

      Either the productId and variantId, or sku must be provided.

      Parameters:
      variantId - value to be set
      Returns:
      Builder
    • sku

      public StagedOrderAddLineItemActionBuilder sku(@Nullable String sku)

      SKU of the ProductVariant.

      Either the productId and variantId, or sku must be provided.

      Parameters:
      sku - value to be set
      Returns:
      Builder
    • quantity

      public StagedOrderAddLineItemActionBuilder quantity(@Nullable Long quantity)

      Quantity of the Product Variant to add to the Cart.

      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • addedAt

      public StagedOrderAddLineItemActionBuilder addedAt(@Nullable 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
      Returns:
      Builder
    • 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:
      builder - function to build the distributionChannel value
      Returns:
      Builder
    • withDistributionChannel

      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:
      builder - function to build the distributionChannel value
      Returns:
      Builder
    • distributionChannel

      public StagedOrderAddLineItemActionBuilder distributionChannel(@Nullable 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
      Returns:
      Builder
    • supplyChannel

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

      Parameters:
      builder - function to build the supplyChannel value
      Returns:
      Builder
    • withSupplyChannel

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

      Parameters:
      builder - function to build the supplyChannel value
      Returns:
      Builder
    • supplyChannel

      public StagedOrderAddLineItemActionBuilder supplyChannel(@Nullable ChannelResourceIdentifier supplyChannel)

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

      Parameters:
      supplyChannel - value to be set
      Returns:
      Builder
    • externalPrice

      Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

      Parameters:
      builder - function to build the externalPrice value
      Returns:
      Builder
    • withExternalPrice

      public StagedOrderAddLineItemActionBuilder withExternalPrice(Function<MoneyBuilder,Money> builder)

      Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

      Parameters:
      builder - function to build the externalPrice value
      Returns:
      Builder
    • externalPrice

      public StagedOrderAddLineItemActionBuilder externalPrice(@Nullable Money externalPrice)

      Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

      Parameters:
      externalPrice - value to be set
      Returns:
      Builder
    • externalTotalPrice

      Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

      Parameters:
      builder - function to build the externalTotalPrice value
      Returns:
      Builder
    • withExternalTotalPrice

      Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

      Parameters:
      builder - function to build the externalTotalPrice value
      Returns:
      Builder
    • externalTotalPrice

      public StagedOrderAddLineItemActionBuilder externalTotalPrice(@Nullable ExternalLineItemTotalPrice externalTotalPrice)

      Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

      Parameters:
      externalTotalPrice - value to be set
      Returns:
      Builder
    • externalTaxRate

      Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode. If the Cart has Multiple ShippingMode, the Tax Rate is accepted but ignored.

      Parameters:
      builder - function to build the externalTaxRate value
      Returns:
      Builder
    • withExternalTaxRate

      Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode. If the Cart has Multiple ShippingMode, the Tax Rate is accepted but ignored.

      Parameters:
      builder - function to build the externalTaxRate value
      Returns:
      Builder
    • externalTaxRate

      public StagedOrderAddLineItemActionBuilder externalTaxRate(@Nullable ExternalTaxRateDraft externalTaxRate)

      Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode. If the Cart has Multiple ShippingMode, the Tax Rate is accepted but ignored.

      Parameters:
      externalTaxRate - value to be set
      Returns:
      Builder
    • inventoryMode

      public StagedOrderAddLineItemActionBuilder inventoryMode(@Nullable InventoryMode inventoryMode)

      Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

      Parameters:
      inventoryMode - value to be set
      Returns:
      Builder
    • shippingDetails

      Container for Line Item-specific addresses.

      Parameters:
      builder - function to build the shippingDetails value
      Returns:
      Builder
    • withShippingDetails

      Container for Line Item-specific addresses.

      Parameters:
      builder - function to build the shippingDetails value
      Returns:
      Builder
    • shippingDetails

      public StagedOrderAddLineItemActionBuilder shippingDetails(@Nullable ItemShippingDetailsDraft shippingDetails)

      Container for Line Item-specific addresses.

      Parameters:
      shippingDetails - value to be set
      Returns:
      Builder
    • custom

      Custom Fields for the Line Item.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields for the Line Item.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      public StagedOrderAddLineItemActionBuilder custom(@Nullable CustomFieldsDraft custom)

      Custom Fields for the Line Item.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the LineItem.

      Returns:
      key
    • getProductId

      @Nullable public String getProductId()

      id of the published Product.

      Either the productId and variantId, or sku must be provided.

      Returns:
      productId
    • getVariantId

      @Nullable public Long getVariantId()

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

      Either the productId and variantId, or sku must be provided.

      Returns:
      variantId
    • getSku

      @Nullable public String getSku()

      SKU of the ProductVariant.

      Either the productId and variantId, or sku must be provided.

      Returns:
      sku
    • getQuantity

      @Nullable public Long getQuantity()

      Quantity of the Product Variant to add to the Cart.

      Returns:
      quantity
    • getAddedAt

      @Nullable 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.

      Returns:
      addedAt
    • getDistributionChannel

      @Nullable 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.

      Returns:
      distributionChannel
    • getSupplyChannel

      @Nullable public ChannelResourceIdentifier getSupplyChannel()

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

      Returns:
      supplyChannel
    • getExternalPrice

      @Nullable public Money getExternalPrice()

      Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

      Returns:
      externalPrice
    • getExternalTotalPrice

      @Nullable public ExternalLineItemTotalPrice getExternalTotalPrice()

      Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

      Returns:
      externalTotalPrice
    • getExternalTaxRate

      @Nullable public ExternalTaxRateDraft getExternalTaxRate()

      Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode. If the Cart has Multiple ShippingMode, the Tax Rate is accepted but ignored.

      Returns:
      externalTaxRate
    • getInventoryMode

      @Nullable public InventoryMode getInventoryMode()

      Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

      Returns:
      inventoryMode
    • getShippingDetails

      @Nullable public ItemShippingDetailsDraft getShippingDetails()

      Container for Line Item-specific addresses.

      Returns:
      shippingDetails
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Line Item.

      Returns:
      custom
    • build

      builds StagedOrderAddLineItemAction with checking for non-null required values
      Specified by:
      build in interface Builder<StagedOrderAddLineItemAction>
      Returns:
      StagedOrderAddLineItemAction
    • buildUnchecked

      public StagedOrderAddLineItemAction buildUnchecked()
      builds StagedOrderAddLineItemAction without checking for non-null required values
      Returns:
      StagedOrderAddLineItemAction
    • of

      factory method for an instance of StagedOrderAddLineItemActionBuilder
      Returns:
      builder
    • of

      create builder for StagedOrderAddLineItemAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder