Class MapBackedRegistry<K,​V>

    • Constructor Detail

      • MapBackedRegistry

        public MapBackedRegistry()
        Creates an empty registry instance, initialised with an empty map
      • MapBackedRegistry

        public MapBackedRegistry​(Map<K,​V> map)
        Creates a registry instance initialise using the passed map
        Parameters:
        map - a Map instance used to initialise the registry.
    • Method Detail

      • registerItem

        public V registerItem​(K key,
                              V value)
        { @inheritDoc }
        Specified by:
        registerItem in interface Registry<K,​V>
        Parameters:
        key - the lookup key for the value to add
        value - the value to add
        Returns:
        the added value
      • registerItems

        public void registerItems​(Map<K,​V> itemMap)
        { @inheritDoc }
        Specified by:
        registerItems in interface Registry<K,​V>
      • removeItem

        public V removeItem​(K key)
        { @inheritDoc }
        Specified by:
        removeItem in interface Registry<K,​V>
        Parameters:
        key - the lookup key for the value to unregister.
        Returns:
        the removed value or null if no value was associated with the key
      • removeItems

        public void removeItems​(Set<K> keys)
        { @inheritDoc }
        Specified by:
        removeItems in interface Registry<K,​V>
        Parameters:
        keys - the Set of lookup keys to remove.
      • putdateItem

        public V putdateItem​(K key,
                             V value)
        { @inheritDoc }
        Specified by:
        putdateItem in interface Registry<K,​V>
        Parameters:
        key - the lookup key of the value to putdate.
        value - the value to be used for the putdate.
        Returns:
        the old value of the item
      • putdateItems

        public void putdateItems​(Map<K,​V> itemMap)
        { @inheritDoc }
        Specified by:
        putdateItems in interface Registry<K,​V>
        Parameters:
        itemMap - a Map of keys & values to add.
      • updateItem

        public V updateItem​(K key,
                            V value)
        { @inheritDoc }
        Specified by:
        updateItem in interface Registry<K,​V>
        Parameters:
        key - the lookup key of the value to update
        value - the value used in the update
        Returns:
        the old value of the item
      • updateItems

        public void updateItems​(Map<K,​V> itemMap)
        { @inheritDoc }
        Specified by:
        updateItems in interface Registry<K,​V>