Class InventoryEntryDraftBuilder

java.lang.Object
com.commercetools.api.models.inventory.InventoryEntryDraftBuilder
All Implemented Interfaces:
Builder<InventoryEntryDraft>

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

     InventoryEntryDraft inventoryEntryDraft = InventoryEntryDraft.builder()
             .sku("{sku}")
             .quantityOnStock(0.3)
             .build()
 
  • Constructor Details

    • InventoryEntryDraftBuilder

      public InventoryEntryDraftBuilder()
  • Method Details

    • sku

      ProductVariant sku of the InventoryEntry.

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

      public InventoryEntryDraftBuilder key(@Nullable String key)

      User-defined unique identifier for the InventoryEntry.

      This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing InventoryEntries with the Import API and the Merchant Center.

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

      Channel that supplies this InventoryEntry.

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

      Channel that supplies this InventoryEntry.

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

      public InventoryEntryDraftBuilder supplyChannel(@Nullable ChannelResourceIdentifier supplyChannel)

      Channel that supplies this InventoryEntry.

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

      public InventoryEntryDraftBuilder quantityOnStock(Long quantityOnStock)

      Overall amount of stock.

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

      public InventoryEntryDraftBuilder minCartQuantity(@Nullable Integer minCartQuantity)

      Minimum quantity that can be added to a Cart. See Quantity limits.

      Parameters:
      minCartQuantity - value to be set
      Returns:
      Builder
    • maxCartQuantity

      public InventoryEntryDraftBuilder maxCartQuantity(@Nullable Integer maxCartQuantity)

      Maximum quantity that can be added to a Cart. See Quantity limits.

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

      public InventoryEntryDraftBuilder restockableInDays(@Nullable Long restockableInDays)

      How often the InventoryEntry is restocked (in days).

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

      public InventoryEntryDraftBuilder expectedDelivery(@Nullable ZonedDateTime expectedDelivery)

      Date and time of the next restock.

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

      Custom Fields of the InventoryEntry.

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

      Custom Fields of the InventoryEntry.

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

      public InventoryEntryDraftBuilder custom(@Nullable CustomFieldsDraft custom)

      Custom Fields of the InventoryEntry.

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

      public String getSku()

      ProductVariant sku of the InventoryEntry.

      Returns:
      sku
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the InventoryEntry.

      This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing InventoryEntries with the Import API and the Merchant Center.

      Returns:
      key
    • getSupplyChannel

      @Nullable public ChannelResourceIdentifier getSupplyChannel()

      Channel that supplies this InventoryEntry.

      Returns:
      supplyChannel
    • getQuantityOnStock

      public Long getQuantityOnStock()

      Overall amount of stock.

      Returns:
      quantityOnStock
    • getMinCartQuantity

      @Nullable public Integer getMinCartQuantity()

      Minimum quantity that can be added to a Cart. See Quantity limits.

      Returns:
      minCartQuantity
    • getMaxCartQuantity

      @Nullable public Integer getMaxCartQuantity()

      Maximum quantity that can be added to a Cart. See Quantity limits.

      Returns:
      maxCartQuantity
    • getRestockableInDays

      @Nullable public Long getRestockableInDays()

      How often the InventoryEntry is restocked (in days).

      Returns:
      restockableInDays
    • getExpectedDelivery

      @Nullable public ZonedDateTime getExpectedDelivery()

      Date and time of the next restock.

      Returns:
      expectedDelivery
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields of the InventoryEntry.

      Returns:
      custom
    • build

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

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

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

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