Class MyCartAddLineItemActionBuilder

java.lang.Object
com.commercetools.api.models.me.MyCartAddLineItemActionBuilder
All Implemented Interfaces:
Builder<MyCartAddLineItemAction>

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

     MyCartAddLineItemAction myCartAddLineItemAction = MyCartAddLineItemAction.builder()
             .build()
 
  • Constructor Details

    • MyCartAddLineItemActionBuilder

      public MyCartAddLineItemActionBuilder()
  • Method Details

    • key

      public MyCartAddLineItemActionBuilder key(@Nullable String key)

      User-defined unique identifier of the LineItem.

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

      public MyCartAddLineItemActionBuilder productId(@Nullable String productId)

      id of the Product.

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

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

      public MyCartAddLineItemActionBuilder variantId(@Nullable Long variantId)

      id of the ProductVariant in the Product.

      If not given, 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 MyCartAddLineItemActionBuilder 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 MyCartAddLineItemActionBuilder quantity(@Nullable Long quantity)

      Number of Line Items to add to the Cart.

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

      public MyCartAddLineItemActionBuilder addedAt(@Nullable ZonedDateTime addedAt)

      Date and time (UTC) the Line Item was 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 MyCartAddLineItemActionBuilder 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 MyCartAddLineItemActionBuilder 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
    • 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 MyCartAddLineItemActionBuilder 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 MyCartAddLineItemActionBuilder 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 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 given, 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()

      Number of Line Items to add to the Cart.

      Returns:
      quantity
    • getAddedAt

      @Nullable public ZonedDateTime getAddedAt()

      Date and time (UTC) the Line Item was 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
    • 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

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

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

      public static MyCartAddLineItemActionBuilder of()
      factory method for an instance of MyCartAddLineItemActionBuilder
      Returns:
      builder
    • of

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