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 is updated with the imported data.

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

      public InventoryImportBuilder sku(String sku)

      Maps to InventoryEntry.sku

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

      public InventoryImportBuilder quantityOnStock(Long quantityOnStock)

      Maps to InventoryEntry.quantityOnStock

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

      public InventoryImportBuilder restockableInDays(@Nullable Long restockableInDays)

      Maps to InventoryEntry.restockableInDays

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

      public InventoryImportBuilder expectedDelivery(@Nullable ZonedDateTime expectedDelivery)

      Maps to InventoryEntry.expectedDelivery

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

      Maps to InventoryEntry.supplyChannel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      Maps to InventoryEntry.supplyChannel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      public InventoryImportBuilder supplyChannel(@Nullable ChannelKeyReference supplyChannel)

      Maps to InventoryEntry.supplyChannel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      Maps to InventoryEntry.custom.

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

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

      Maps to InventoryEntry.custom.

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

      public InventoryImportBuilder custom(@Nullable Custom custom)

      Maps to InventoryEntry.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 is updated with the imported data.

      Returns:
      key
    • getSku

      public String getSku()

      Maps to InventoryEntry.sku

      Returns:
      sku
    • getQuantityOnStock

      public Long getQuantityOnStock()

      Maps to InventoryEntry.quantityOnStock

      Returns:
      quantityOnStock
    • getRestockableInDays

      @Nullable public Long getRestockableInDays()

      Maps to InventoryEntry.restockableInDays

      Returns:
      restockableInDays
    • getExpectedDelivery

      @Nullable public ZonedDateTime getExpectedDelivery()

      Maps to InventoryEntry.expectedDelivery

      Returns:
      expectedDelivery
    • getSupplyChannel

      @Nullable public ChannelKeyReference getSupplyChannel()

      Maps to InventoryEntry.supplyChannel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Returns:
      supplyChannel
    • getCustom

      @Nullable public Custom getCustom()

      Maps to InventoryEntry.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