Class InventoryQuantityValueBuilder

java.lang.Object
com.commercetools.history.models.change_value.InventoryQuantityValueBuilder
All Implemented Interfaces:
Builder<InventoryQuantityValue>

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

     InventoryQuantityValue inventoryQuantityValue = InventoryQuantityValue.builder()
             .quantityOnStock(1)
             .availableQuantity(1)
             .build()
 
  • Constructor Details

    • InventoryQuantityValueBuilder

      public InventoryQuantityValueBuilder()
  • Method Details

    • quantityOnStock

      public InventoryQuantityValueBuilder quantityOnStock(Integer quantityOnStock)

      Overall amount of stock (availableQuantity + reserved).

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

      public InventoryQuantityValueBuilder availableQuantity(Integer availableQuantity)

      Available amount of stock (quantityOnStock - reserved).

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

      public Integer getQuantityOnStock()

      Overall amount of stock (availableQuantity + reserved).

      Returns:
      quantityOnStock
    • getAvailableQuantity

      public Integer getAvailableQuantity()

      Available amount of stock (quantityOnStock - reserved).

      Returns:
      availableQuantity
    • build

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

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

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

      create builder for InventoryQuantityValue instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder