Interface ItemState


public interface ItemState

The item's state.


Example to create an instance using the builder pattern

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

    • getQuantity

      @NotNull @NotNull Long getQuantity()
      Returns:
      quantity
    • getState

      @NotNull @Valid @NotNull @Valid StateKeyReference getState()

      Maps to ItemState.state.

      Returns:
      state
    • setQuantity

      void setQuantity(Long quantity)
      set quantity
      Parameters:
      quantity - value to be set
    • setState

      void setState(StateKeyReference state)

      Maps to ItemState.state.

      Parameters:
      state - value to be set
    • of

      static ItemState of()
      factory method
      Returns:
      instance of ItemState
    • of

      static ItemState of(ItemState template)
      factory method to create a shallow copy ItemState
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ItemState deepCopy(@Nullable ItemState template)
      factory method to create a deep copy of ItemState
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ItemStateBuilder builder()
      builder factory method for ItemState
      Returns:
      builder
    • builder

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

      default <T> T withItemState(Function<ItemState,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ItemState> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference