Class ItemStateBuilder

java.lang.Object
com.commercetools.importapi.models.orders.ItemStateBuilder
All Implemented Interfaces:
Builder<ItemState>

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

     ItemState itemState = ItemState.builder()
             .quantity(0.3)
             .state(stateBuilder -> stateBuilder)
             .build()
 
  • Constructor Details

    • ItemStateBuilder

      public ItemStateBuilder()
  • Method Details

    • quantity

      public ItemStateBuilder quantity(Long quantity)
      set the value to the quantity
      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • state

      Maps to ItemState.state.

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

      Maps to ItemState.state.

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

      public ItemStateBuilder state(StateKeyReference state)

      Maps to ItemState.state.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • getQuantity

      public Long getQuantity()
      value of quantity}
      Returns:
      quantity
    • getState

      public StateKeyReference getState()

      Maps to ItemState.state.

      Returns:
      state
    • build

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

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

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

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