Interface StockRepository

All Known Implementing Classes:
MongoStockRepository

@Repository public interface StockRepository
Interface used for dealing with storage and retrieval of stock
  • Method Details

    • saveStock

      Stock saveStock(Stock stock)
      Saves the stock to storage
      Parameters:
      stock - Stock saved
      Returns:
      stock saved
    • deleteStock

      void deleteStock(String ticket)
      Removes the stock with given ticket
      Parameters:
      ticket - Ticket associated with the stock
    • getStock

      Optional<Stock> getStock(String ticket)
      Finds the stock in storage
      Parameters:
      ticket - Ticket associated with the stock
      Returns:
      Stock if found or empty if not
    • getStocks

      List<Stock> getStocks()
      Finds all the stocks saved
      Returns:
      List of all the stocks saved