Class ItemShippingTargetBuilder

java.lang.Object
com.commercetools.history.models.common.ItemShippingTargetBuilder
All Implemented Interfaces:
Builder<ItemShippingTarget>

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

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

    • ItemShippingTargetBuilder

      public ItemShippingTargetBuilder()
  • Method Details

    • addressKey

      public ItemShippingTargetBuilder addressKey(String addressKey)

      The key of the address in the cart's itemShippingAddresses

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

      public ItemShippingTargetBuilder quantity(Integer quantity)

      The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

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

      public String getAddressKey()

      The key of the address in the cart's itemShippingAddresses

      Returns:
      addressKey
    • getQuantity

      public Integer getQuantity()

      The quantity of items that should go to the address with the specified addressKey. Only positive values are allowed. Using 0 as quantity is also possible in a draft object, but the element will not be present in the resulting ItemShippingDetails.

      Returns:
      quantity
    • build

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

      public 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

      public static ItemShippingTargetBuilder of(ItemShippingTarget template)
      create builder for ItemShippingTarget instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder