Class DeliveryBuilder

java.lang.Object
com.commercetools.importapi.models.orders.DeliveryBuilder
All Implemented Interfaces:
Builder<Delivery>

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

     Delivery delivery = Delivery.builder()
             .id("{id}")
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .plusItems(itemsBuilder -> itemsBuilder)
             .plusParcels(parcelsBuilder -> parcelsBuilder)
             .build()
 
  • Constructor Details

    • DeliveryBuilder

      public DeliveryBuilder()
  • Method Details

    • id

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

      public DeliveryBuilder createdAt(ZonedDateTime createdAt)
      set the value to the createdAt
      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • items

      public DeliveryBuilder items(DeliveryItem... items)
      set values to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • items

      public DeliveryBuilder items(List<DeliveryItem> items)
      set value to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • plusItems

      public DeliveryBuilder plusItems(DeliveryItem... items)
      add values to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • plusItems

      add the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • withItems

      set the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • addItems

      add the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • setItems

      set the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • parcels

      public DeliveryBuilder parcels(Parcel... parcels)
      set values to the parcels
      Parameters:
      parcels - value to be set
      Returns:
      Builder
    • parcels

      public DeliveryBuilder parcels(List<Parcel> parcels)
      set value to the parcels
      Parameters:
      parcels - value to be set
      Returns:
      Builder
    • plusParcels

      public DeliveryBuilder plusParcels(Parcel... parcels)
      add values to the parcels
      Parameters:
      parcels - value to be set
      Returns:
      Builder
    • plusParcels

      public DeliveryBuilder plusParcels(Function<ParcelBuilder,ParcelBuilder> builder)
      add the value to the parcels using the builder function
      Parameters:
      builder - function to build the parcels value
      Returns:
      Builder
    • withParcels

      public DeliveryBuilder withParcels(Function<ParcelBuilder,ParcelBuilder> builder)
      set the value to the parcels using the builder function
      Parameters:
      builder - function to build the parcels value
      Returns:
      Builder
    • addParcels

      public DeliveryBuilder addParcels(Function<ParcelBuilder,Parcel> builder)
      add the value to the parcels using the builder function
      Parameters:
      builder - function to build the parcels value
      Returns:
      Builder
    • setParcels

      public DeliveryBuilder setParcels(Function<ParcelBuilder,Parcel> builder)
      set the value to the parcels using the builder function
      Parameters:
      builder - function to build the parcels value
      Returns:
      Builder
    • address

      set the value to the address using the builder function
      Parameters:
      builder - function to build the address value
      Returns:
      Builder
    • withAddress

      public DeliveryBuilder withAddress(Function<AddressBuilder,Address> builder)
      set the value to the address using the builder function
      Parameters:
      builder - function to build the address value
      Returns:
      Builder
    • address

      public DeliveryBuilder address(@Nullable Address address)
      set the value to the address
      Parameters:
      address - value to be set
      Returns:
      Builder
    • getId

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

      public ZonedDateTime getCreatedAt()
      value of createdAt}
      Returns:
      createdAt
    • getItems

      public List<DeliveryItem> getItems()
      value of items}
      Returns:
      items
    • getParcels

      public List<Parcel> getParcels()
      value of parcels}
      Returns:
      parcels
    • getAddress

      @Nullable public Address getAddress()
      value of address}
      Returns:
      address
    • build

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

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

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

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