Class InventoryEntryBuilder

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

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

     InventoryEntry inventoryEntry = InventoryEntry.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .sku("{sku}")
             .quantityOnStock(0.3)
             .availableQuantity(0.3)
             .build()
 
  • Constructor Details

    • InventoryEntryBuilder

      public InventoryEntryBuilder()
  • Method Details

    • id

      public InventoryEntryBuilder id(String id)

      Unique identifier of the InventoryEntry.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public InventoryEntryBuilder version(Long version)

      Current version of the InventoryEntry.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public InventoryEntryBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the InventoryEntry was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public InventoryEntryBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the InventoryEntry was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the InventoryEntry.

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

      IDs and references that last modified the InventoryEntry.

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

      public InventoryEntryBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the InventoryEntry.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the InventoryEntry.

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

      public InventoryEntryBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the InventoryEntry.

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

      public InventoryEntryBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the InventoryEntry.

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

      User-defined unique identifier of the InventoryEntry.

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

      public InventoryEntryBuilder sku(String sku)

      ProductVariant sku of the InventoryEntry.

      Parameters:
      sku - 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 InventoryEntryBuilder supplyChannel(@Nullable ChannelReference supplyChannel)

      Channel that supplies this InventoryEntry.

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

      public InventoryEntryBuilder quantityOnStock(Long quantityOnStock)

      Overall amount of stock (availableQuantity + reserved).

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

      public InventoryEntryBuilder availableQuantity(Long availableQuantity)

      Available amount of stock (quantityOnStock - reserved).

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

      public InventoryEntryBuilder restockableInDays(@Nullable Long restockableInDays)

      How often the InventoryEntry is restocked (in days).

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

      public InventoryEntryBuilder 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

      Custom Fields of the InventoryEntry.

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

      public String getId()

      Unique identifier of the InventoryEntry.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the InventoryEntry.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the InventoryEntry was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the InventoryEntry was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the InventoryEntry.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the InventoryEntry.

      Returns:
      createdBy
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the InventoryEntry.

      Returns:
      key
    • getSku

      public String getSku()

      ProductVariant sku of the InventoryEntry.

      Returns:
      sku
    • getSupplyChannel

      @Nullable public ChannelReference getSupplyChannel()

      Channel that supplies this InventoryEntry.

      Returns:
      supplyChannel
    • getQuantityOnStock

      public Long getQuantityOnStock()

      Overall amount of stock (availableQuantity + reserved).

      Returns:
      quantityOnStock
    • getAvailableQuantity

      public Long getAvailableQuantity()

      Available amount of stock (quantityOnStock - reserved).

      Returns:
      availableQuantity
    • 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 CustomFields getCustom()

      Custom Fields of the InventoryEntry.

      Returns:
      custom
    • build

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

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

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

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