Class ItemShippingTargetBuilder

java.lang.Object
com.commercetools.api.models.cart.ItemShippingTargetBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ItemShippingTarget>

public class ItemShippingTargetBuilder extends Object implements io.vrap.rmf.base.client.Builder<ItemShippingTarget>
ItemShippingTargetBuilder
Example to create an instance using the builder pattern

     ItemShippingTarget itemShippingTarget = ItemShippingTarget.builder()
             .addressKey("{addressKey}")
             .quantity(0.3)
             .build()
 
  • Constructor Details

  • Method Details

    • addressKey

      Key of the address in the Cart itemShippingAddresses. Duplicate address keys are not allowed.

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

      Quantity of Line Items or Custom Line Items shipped to the address with the specified addressKey.

      If a quantity is updated to 0 when defining ItemShippingDetailsDraft, the targets are removed from a Line Item or Custom Line Item in the resulting ItemShippingDetails.

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

      User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

      It connects Line Item quantities with individual shipping addresses.

      Parameters:
      shippingMethodKey - value to be set
      Returns:
      Builder
    • getAddressKey

      Key of the address in the Cart itemShippingAddresses. Duplicate address keys are not allowed.

      Returns:
      addressKey
    • getQuantity

      public Long getQuantity()

      Quantity of Line Items or Custom Line Items shipped to the address with the specified addressKey.

      If a quantity is updated to 0 when defining ItemShippingDetailsDraft, the targets are removed from a Line Item or Custom Line Item in the resulting ItemShippingDetails.

      Returns:
      quantity
    • getShippingMethodKey

      User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

      It connects Line Item quantities with individual shipping addresses.

      Returns:
      shippingMethodKey
    • build

      builds ItemShippingTarget with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ItemShippingTarget>
      Returns:
      ItemShippingTarget
    • buildUnchecked

      builds ItemShippingTarget without checking for non-null required values
      Returns:
      ItemShippingTarget
    • of

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

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