Class ItemShippingDetailsBuilder

java.lang.Object
com.commercetools.api.models.cart.ItemShippingDetailsBuilder
All Implemented Interfaces:
Builder<ItemShippingDetails>

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

     ItemShippingDetails itemShippingDetails = ItemShippingDetails.builder()
             .plusTargets(targetsBuilder -> targetsBuilder)
             .valid(true)
             .build()
 
  • Constructor Details

    • ItemShippingDetailsBuilder

      public ItemShippingDetailsBuilder()
  • Method Details

    • targets

      public ItemShippingDetailsBuilder targets(ItemShippingTarget... targets)

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

      Parameters:
      targets - value to be set
      Returns:
      Builder
    • targets

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

      Parameters:
      targets - value to be set
      Returns:
      Builder
    • plusTargets

      public ItemShippingDetailsBuilder plusTargets(ItemShippingTarget... targets)

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

      Parameters:
      targets - value to be set
      Returns:
      Builder
    • plusTargets

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

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

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

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

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

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

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

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

      public ItemShippingDetailsBuilder valid(Boolean valid)
      • true if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in targets.
      • false if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in targets. Ordering a Cart when the value is false returns an InvalidItemShippingDetails error.
      Parameters:
      valid - value to be set
      Returns:
      Builder
    • getTargets

      public List<ItemShippingTarget> getTargets()

      Holds information on the quantity of Line Items or Custom Line Items and the address it is shipped.

      Returns:
      targets
    • getValid

      public Boolean getValid()
      • true if the quantity of Line Items or Custom Line Items is equal to the sum of sub-quantities defined in targets.
      • false if the quantity of Line Items or Custom Line Items is not equal to the sum of sub-quantities defined in targets. Ordering a Cart when the value is false returns an InvalidItemShippingDetails error.
      Returns:
      valid
    • build

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

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

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

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