Class DeliveryItemBuilder

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

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

     DeliveryItem deliveryItem = DeliveryItem.builder()
             .id("{id}")
             .quantity(1)
             .build()
 
  • Constructor Details

    • DeliveryItemBuilder

      public DeliveryItemBuilder()
  • Method Details

    • id

      public DeliveryItemBuilder id(String id)
      set the value to the id
      Parameters:
      id - value to be set
      Returns:
      Builder
    • quantity

      public DeliveryItemBuilder quantity(Integer quantity)
      set the value to the quantity
      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • getId

      public String getId()
      value of id}
      Returns:
      id
    • getQuantity

      public Integer getQuantity()
      value of quantity}
      Returns:
      quantity
    • build

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

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

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

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