Package org.verapdf.core
Interface Registry<K,V>
- Type Parameters:
K
- the Registry key typeV
- the Registry value type
- All Superinterfaces:
Directory<K,
V>
- All Known Implementing Classes:
MapBackedRegistry
A read/write Registry that supports key and value types.
- Author:
- Carl Wilson
-
Method Summary
Modifier and TypeMethodDescriptionputdateItem
(K key, V value) Registers or updates an item in Registry caring not if the item already exists.void
putdateItems
(Map<K, V> itemMap) Registers or updates all item in Registry caring not if the items already exist or not.registerItem
(K key, V value) Add a single item to the Registryvoid
registerItems
(Map<K, V> itemMap) Add a Map<K, V> of items to the RegistryremoveItem
(K key) Unregister an item from the Registry.void
removeItems
(Set<K> keys) Unregister a Set of items from the Registry.updateItem
(K key, V value) Updates the value associated with the key and throws and exception if the item isn't registered.void
updateItems
(Map<K, V> itemMap)
-
Method Details
-
registerItem
Add a single item to the Registry- Parameters:
key
- the lookup key for the value to addvalue
- the value to add- Returns:
- the added value
-
registerItems
Add a Map<K, V> of items to the Registry- Parameters:
itemMap
-
-
removeItem
Unregister an item from the Registry.- 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
Unregister a Set of items from the Registry.- Parameters:
keys
- the Set of lookup keys to remove.
-
putdateItem
Registers or updates an item in Registry caring not if the item already exists.- 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
Registers or updates all item in Registry caring not if the items already exist or not.- Parameters:
itemMap
- a Map of keys & values to add.
-
updateItem
Updates the value associated with the key and throws and exception if the item isn't registered.- Parameters:
key
- the lookup key of the value to updatevalue
- the value used in the update- Returns:
- the old value of the item
- Throws:
NoSuchElementException
- if no value is associated with the key
-
updateItems
- Parameters:
itemMap
-- Throws:
NoSuchElementException
- if no value is associated with one of the keys
-