Interface GlobalStock

  • All Known Implementing Classes:
    GlobalStockImpl

    public interface GlobalStock
    Represents the stock levels of all local store branches.
    Author:
    Maximilian Schiedermeier
    • Method Detail

      • getStock

        int getStock​(String city,
                     Long isbn)
        Returns the amount in stock of a given book in a given city.
        Parameters:
        city - for the city of interest
        isbn - for book id of interest
        Returns:
        the amount in stock
      • setStock

        void setStock​(String city,
                      Long isbn,
                      Integer amount)
        Updates the stock for a given city.
        Parameters:
        city - for the city of interest
        isbn - for book id of interest
        amount - for the new amount in stock
      • getStoreLocations

        Collection<String> getStoreLocations()
        Returns a list of all cities that have a local stock.
        Returns:
        a list of all cities (strings)
      • getEntireStoreStock

        Map<Long,​Integer> getEntireStoreStock​(String city)
        Returns the entire stock of a local store.
        Parameters:
        city - for the city of interest
        Returns:
        a map holding for each book the amount of books in stock at the specified location.