Class InventoryItem<T extends InventoryItem<T>>

    • Method Detail

      • hasSufficientQuantity

        public boolean hasSufficientQuantity​(Quantity quantity)
        Returns whether the InventoryItem is available in exactly or more of the given quantity.
        Parameters:
        quantity - must not be null.
        Returns:
      • decreaseQuantity

        public T decreaseQuantity​(Quantity quantity)
        Decreases the quantity of the current InventoryItem by the given Quantity.
        Parameters:
        quantity - must not be null.
      • increaseQuantity

        public T increaseQuantity​(Quantity quantity)
        Increases the quantity of the current InventoryItem by the given Quantity.
        Parameters:
        quantity - must not be null.
      • keepsTrackOf

        public boolean keepsTrackOf​(Product product)
        Returns whether the InventoryItem belongs to the given Product.
        Parameters:
        product - must not be null.
        Returns:
      • getProduct

        protected abstract Product getProduct()
      • getQuantity

        public Quantity getQuantity()