Interface ItemRepo

All Known Implementing Classes:
ItemHashMap

public interface ItemRepo
Repository interface for managing items, with simple getters.
  • Method Summary

    Modifier and Type
    Method
    Description
    getItem(String itemId)
    Retrieves an item by its ID.
    Retrieves the items in the repository as a list.
    int
    Retrieves the number of items in the repository.
  • Method Details

    • getItem

      Optional<Item> getItem(String itemId)
      Retrieves an item by its ID.
      Parameters:
      itemId - The ID of the item to retrieve.
      Returns:
      An Optional containing the Item if found, or empty if not found.
      Preconditions:
      itemId is not null.
    • getItemsAsList

      List<Item> getItemsAsList()
      Retrieves the items in the repository as a list.
      Returns:
      A list of all Item objects in the repository.
    • getSize

      int getSize()
      Retrieves the number of items in the repository.
      Returns:
      The number of items in the repository.