Class SimpleMapFactory
- java.lang.Object
-
- uk.gov.gchq.gaffer.mapstore.factory.SimpleMapFactory
-
- All Implemented Interfaces:
MapFactory
public class SimpleMapFactory extends Object implements MapFactory
Default implementation of theMapFactoryinterface, used to create map instances for theMapStore.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAP_CLASSstatic StringMAP_CLASS_DEFAULT
-
Constructor Summary
Constructors Constructor Description SimpleMapFactory()
-
Method Summary
All Methods Instance Methods Concrete 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.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.mapstore.factory.MapFactory
updateValue
-
-
-
-
Field Detail
-
MAP_CLASS
public static final String MAP_CLASS
- See Also:
- Constant Field Values
-
MAP_CLASS_DEFAULT
public static final String MAP_CLASS_DEFAULT
-
-
Method Detail
-
initialise
public void initialise(Schema schema, MapStoreProperties properties)
Description copied from interface:MapFactoryInitialise the map with the specified schema and properties.- Specified by:
initialisein interfaceMapFactory- Parameters:
schema- the schema to applyproperties- the store properties to apply
-
getMap
public <K,V> Map<K,V> getMap(String mapName, Class<K> keyClass, Class<V> valueClass)
Description copied from interface:MapFactoryRetrieve a namedMap. If the requested map does not exist, a new map is created and cached.- Specified by:
getMapin interfaceMapFactory- 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
public <K,V> MultiMap<K,V> getMultiMap(String mapName, Class<K> keyClass, Class<V> valueClass)
Description copied from interface:MapFactoryRetrieve a namedMultiMap. If the requested map does not exist, a new multi map is created and cached.- Specified by:
getMultiMapin interfaceMapFactory- 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
-
clear
public void clear()
Description copied from interface:MapFactoryClear any currently configured Maps.- Specified by:
clearin interfaceMapFactory
-
cloneElement
public Element cloneElement(Element element, Schema schema)
Description copied from interface:MapFactoryClone an element.- Specified by:
cloneElementin interfaceMapFactory- Parameters:
element- the element to cloneschema- the relevant schema- Returns:
- the cloned element
-
-