/** * Removes an element and returns the removed element. * * @param key key of the element that should be removed * @return element that was removed, or null if no element with the given * key exists */ E remove(@NonNull K key);
/** * Returns list of items with a certain type containing all of the given tags. * * @param type * - item type as defined by {@link ItemFactory}s * @param tags * - array of tags to be present on the returned items. * @return list of items which contains all of the given tags. */ public @NonNull Collection<Item> getItemsByTagAndType(@NonNull String type, @NonNull String... tags);
/** * Adds a {@link RegistryChangeListener} to the registry. * * @param listener registry change listener */ void addRegistryChangeListener(@NonNull RegistryChangeListener<E> listener);
/** * Removes a {@link RegistryChangeListener} from the registry. * * @param listener registry change listener */ void removeRegistryChangeListener(@NonNull RegistryChangeListener<E> listener);
/** * This method retrieves a single item from the registry. * * @param name the item name * @return the uniquely identified item * @throws ItemNotFoundException if no item matches the input */ public @NonNull Item getItem(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 * * @param name the item name, a part of the item name or a search pattern * @return the uniquely identified item * @throws ItemNotFoundException if no item matches the input * @throws ItemNotUniqueException if multiply items match the input */ public @NonNull Item getItemByPattern(@NonNull String name) throws ItemNotFoundException, ItemNotUniqueException;
/** * Adds an element. * * @param element element to be added */ void add(@NonNull E element);
/** * Removes all metadata of a given item * * @param itemname the name of the item for which the metadata is to be removed. */ void removeItemMetadata(@NonNull String name);
/** * Updates an element. * * @param element element to be updated * @return returns the old element or null if no element with the same key * exists */ E update(@NonNull E element);
/** * Adds the given element to the according {@link ManagedProvider}. * * @param element element to be added (must not be null) * @return the added element or newly created object of the same type * @throws IllegalStateException if no ManagedProvider is available */ public @NonNull E add(@NonNull E element);
/** * Returns list of items which contains all of the given tags. * * @param typeFilter * - subclass of {@link GenericItem} to filter the resulting list * for. * @param tags * - array of tags to be present on the returned items. * @return list of items which contains all of the given tags, which is * filtered by the given type filter. */ public @NonNull <T extends Item> Collection<T> getItemsByTag(@NonNull Class<T> typeFilter, @NonNull String... tags);