Class InventoryImportBuilder

java.lang.Object
com.commercetools.importapi.models.inventories.InventoryImportBuilder
All Implemented Interfaces:
Builder<InventoryImport>

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

     InventoryImport inventoryImport = InventoryImport.builder()
             .key("{key}")
             .sku("{sku}")
             .quantityOnStock(0.3)
             .build()
 
  • Constructor Details

    • InventoryImportBuilder

      public InventoryImportBuilder()
  • Method Details

    • key

      public InventoryImportBuilder key(String key)

      User-defined unique identifier. If an InventoryEntry with this key exists, it will be updated with the imported data.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • sku

      public InventoryImportBuilder sku(String sku)

      Maps to Inventory.sku

      Parameters:
      sku - value to be set
      Returns:
      Builder
    • quantityOnStock

      public InventoryImportBuilder quantityOnStock(Long quantityOnStock)

      Maps to Inventory.quantityOnStock

      Parameters:
      quantityOnStock - value to be set
      Returns:
      Builder
    • restockableInDays

      public InventoryImportBuilder restockableInDays(@Nullable Long restockableInDays)

      Maps to Inventory.restockableInDays

      Parameters:
      restockableInDays - value to be set
      Returns:
      Builder
    • expectedDelivery

      public InventoryImportBuilder expectedDelivery(@Nullable ZonedDateTime expectedDelivery)

      Maps to Inventory.expectedDelivery

      Parameters:
      expectedDelivery - value to be set
      Returns:
      Builder
    • supplyChannel

      Maps to Inventory.supplyChannel

      Parameters:
      builder - function to build the supplyChannel value
      Returns:
      Builder
    • withSupplyChannel

      Maps to Inventory.supplyChannel

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

      public InventoryImportBuilder supplyChannel(@Nullable ChannelKeyReference supplyChannel)

      Maps to Inventory.supplyChannel

      Parameters:
      supplyChannel - value to be set
      Returns:
      Builder
    • custom

      Maps to Inventory.custom.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      public InventoryImportBuilder withCustom(Function<CustomBuilder,Custom> builder)

      Maps to Inventory.custom.

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

      public InventoryImportBuilder custom(@Nullable Custom custom)

      Maps to Inventory.custom.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

      User-defined unique identifier. If an InventoryEntry with this key exists, it will be updated with the imported data.

      Returns:
      key
    • getSku

      public String getSku()

      Maps to Inventory.sku

      Returns:
      sku
    • getQuantityOnStock

      public Long getQuantityOnStock()

      Maps to Inventory.quantityOnStock

      Returns:
      quantityOnStock
    • getRestockableInDays

      @Nullable public Long getRestockableInDays()

      Maps to Inventory.restockableInDays

      Returns:
      restockableInDays
    • getExpectedDelivery

      @Nullable public ZonedDateTime getExpectedDelivery()

      Maps to Inventory.expectedDelivery

      Returns:
      expectedDelivery
    • getSupplyChannel

      @Nullable public ChannelKeyReference getSupplyChannel()

      Maps to Inventory.supplyChannel

      Returns:
      supplyChannel
    • getCustom

      @Nullable public Custom getCustom()

      Maps to Inventory.custom.

      Returns:
      custom
    • build

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

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

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

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