Interface MapFactory
-
- All Known Implementing Classes:
SimpleMapFactory
public interface MapFactoryInterface describing factory classes for creating backing map instances to be used as the data store for aMapStore.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclear()Clear any currently configured Maps.ElementcloneElement(Element element, Schema schema)Clone an element.<K,V>
Map<K,V>getMap(String mapName, Class<K> keyClass, Class<V> valueClass)Retrieve a namedMap.<K,V>
MultiMap<K,V>getMultiMap(String mapName, Class<K> keyClass, Class<V> valueClass)Retrieve a namedMultiMap.voidinitialise(Schema schema, MapStoreProperties properties)Initialise the map with the specified schema and properties.default <K,V>
voidupdateValue(Map<K,V> map, K key, V updatedValue)Update a value associated with a key in a specified map object.
-
-
-
Method Detail
-
initialise
void initialise(Schema schema, MapStoreProperties properties)
Initialise the map with the specified schema and properties.- Parameters:
schema- the schema to applyproperties- the store properties to apply
-
getMap
<K,V> Map<K,V> getMap(String mapName, Class<K> keyClass, Class<V> valueClass)
Retrieve a namedMap. If the requested map does not exist, a new map is created and cached.- Type Parameters:
K- the type of the map keysV- the type of the map values- Parameters:
mapName- the name of the map to retrievekeyClass- the class type to use for the map keysvalueClass- the class type to use for the map values- Returns:
- the requested
Mapobject
-
getMultiMap
<K,V> MultiMap<K,V> getMultiMap(String mapName, Class<K> keyClass, Class<V> valueClass)
Retrieve a namedMultiMap. If the requested map does not exist, a new multi map is created and cached.- Type Parameters:
K- the type of the map keysV- the type of the map values- Parameters:
mapName- the name of the multi map to retrievekeyClass- the class type to use for the map keysvalueClass- the class type to use for the map values- Returns:
- the requested
MultiMapobject
-
updateValue
default <K,V> void updateValue(Map<K,V> map, K key, V updatedValue)
Update a value associated with a key in a specified map object.- Type Parameters:
K- the type of the map keysV- the type of the map values- Parameters:
map- the map to updatekey- the key to update the corresponding value forupdatedValue- the updated value
-
clear
void clear()
Clear any currently configured Maps.
-
-