Interface ItemRegistry

  • All Known Subinterfaces:
    ItemUIRegistry

    public interface ItemRegistry
    The ItemRegistry is the central place, where items are kept in memory and their state is permanently tracked. So any code that requires the current state of items should use this service (instead of trying to keep their own local copy of the items). Items are registered by ItemProviders, which can provision them from any source they like and also dynamically remove or add items.
    Author:
    Kai Kreuzer - Initial contribution
    • Method Detail

      • getItemByPattern

        Item getItemByPattern​(String name)
                       throws ItemNotFoundException,
                              ItemNotUniqueException
        This method retrieves a single item from the registry. Search patterns and shortened versions are supported, if they uniquely identify an item
        Parameters:
        name - the item name, a part of the item name or a search pattern
        Returns:
        the uniquely identified item
        Throws:
        ItemNotFoundException - if no item matches the input
        ItemNotUniqueException - if multiply items match the input
      • getItems

        Collection<Item> getItems()
        This method retrieves all items that are currently available in the registry
        Returns:
        a collection of all available items
      • getItems

        Collection<Item> getItems​(String pattern)
        This method retrieves all items that match a given search pattern
        Returns:
        a collection of all items matching the search pattern
      • isValidItemName

        boolean isValidItemName​(String itemName)
        Checks whether itemName matches the item name conventions. Item names must only consist out of alpha-numerical characters and underscores (_).
        Parameters:
        itemName - the item name to validate
        Returns:
        true, if the name is valid