Class InventoryConfigurationBuilder

java.lang.Object
com.commercetools.api.models.project.InventoryConfigurationBuilder
All Implemented Interfaces:
Builder<InventoryConfiguration>

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

     InventoryConfiguration inventoryConfiguration = InventoryConfiguration.builder()
             .releaseExpiredReservations(true)
             .build()
 
  • Constructor Details

    • InventoryConfigurationBuilder

      public InventoryConfigurationBuilder()
  • Method Details

    • reservationExpirationInMinutes

      public InventoryConfigurationBuilder reservationExpirationInMinutes(@Nullable Integer reservationExpirationInMinutes)

      The number of minutes after which a Reservation expires. To use the ReserveOnCart inventory mode, this field must be set.

      Parameters:
      reservationExpirationInMinutes - value to be set
      Returns:
      Builder
    • releaseExpiredReservations

      public InventoryConfigurationBuilder releaseExpiredReservations(Boolean releaseExpiredReservations)

      If set to true, Reservations are marked as Expired once their reservationExpirationInMinutes is reached. The reserved inventory is then made available. If set to false, tracking Line Items with expired reservations becomes your responsibility.

      Parameters:
      releaseExpiredReservations - value to be set
      Returns:
      Builder
    • getReservationExpirationInMinutes

      @Nullable public Integer getReservationExpirationInMinutes()

      The number of minutes after which a Reservation expires. To use the ReserveOnCart inventory mode, this field must be set.

      Returns:
      reservationExpirationInMinutes
    • getReleaseExpiredReservations

      public Boolean getReleaseExpiredReservations()

      If set to true, Reservations are marked as Expired once their reservationExpirationInMinutes is reached. The reserved inventory is then made available. If set to false, tracking Line Items with expired reservations becomes your responsibility.

      Returns:
      releaseExpiredReservations
    • build

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

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

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

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