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
public interface Registry<K,V> extends Directory<K,V>
A read/write Registry that supports key and value types.- Author:
- Carl Wilson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VputdateItem(K key, V value)Registers or updates an item in Registry caring not if the item already exists.voidputdateItems(Map<K,V> itemMap)Registers or updates all item in Registry caring not if the items already exist or not.VregisterItem(K key, V value)Add a single item to the RegistryvoidregisterItems(Map<K,V> itemMap)Add a Mapof items to the Registry VremoveItem(K key)Unregister an item from the Registry.voidremoveItems(Set<K> keys)Unregister a Set of items from the Registry.VupdateItem(K key, V value)Updates the value associated with the key and throws and exception if the item isn't registered.voidupdateItems(Map<K,V> itemMap)
-
-
-
Method Detail
-
registerItem
V registerItem(K key, V value)
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
void registerItems(Map<K,V> itemMap)
Add a Mapof items to the Registry - Parameters:
itemMap-
-
removeItem
V removeItem(K key)
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
void removeItems(Set<K> keys)
Unregister a Set of items from the Registry.- Parameters:
keys- the Set of lookup keys to remove.
-
putdateItem
V putdateItem(K key, V value)
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
void putdateItems(Map<K,V> itemMap)
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
V updateItem(K key, V value)
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
-
-