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 theMapFactory
interface, used to create map instances for theMapStore
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MAP_CLASS
static String
MAP_CLASS_DEFAULT
-
Constructor Summary
Constructors Constructor Description SimpleMapFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear any currently configured Maps.Element
cloneElement(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
.void
initialise(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:MapFactory
Initialise the map with the specified schema and properties.- Specified by:
initialise
in 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:MapFactory
Retrieve a namedMap
. If the requested map does not exist, a new map is created and cached.- Specified by:
getMap
in 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
Map
object
-
getMultiMap
public <K,V> MultiMap<K,V> getMultiMap(String mapName, Class<K> keyClass, Class<V> valueClass)
Description copied from interface:MapFactory
Retrieve a namedMultiMap
. If the requested map does not exist, a new multi map is created and cached.- Specified by:
getMultiMap
in 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
MultiMap
object
-
clear
public void clear()
Description copied from interface:MapFactory
Clear any currently configured Maps.- Specified by:
clear
in interfaceMapFactory
-
cloneElement
public Element cloneElement(Element element, Schema schema)
Description copied from interface:MapFactory
Clone an element.- Specified by:
cloneElement
in interfaceMapFactory
- Parameters:
element
- the element to cloneschema
- the relevant schema- Returns:
- the cloned element
-
-