Interface ItemRegistry

  • All Known Subinterfaces:

    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.
    Kai Kreuzer - Initial contribution
    • Method Detail

      • getItemByPattern

        Item getItemByPattern​(String name)
                       throws ItemNotFoundException,
        This method retrieves a single item from the registry. Search patterns and shortened versions are supported, if they uniquely identify an item
        name - the item name, a part of the item name or a search pattern
        the uniquely identified item
        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
        a collection of all available items
      • getItems

        Collection<Item> getItems​(String pattern)
        This method retrieves all items that match a given search pattern
        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 (_).
        itemName - the item name to validate
        true, if the name is valid