Interface MapFactory

  • All Known Implementing Classes:
    SimpleMapFactory

    public interface MapFactory
    Interface describing factory classes for creating backing map instances to be used as the data store for a MapStore.
    • Method Detail

      • initialise

        void initialise​(Schema schema,
                        MapStoreProperties properties)
        Initialise the map with the specified schema and properties.
        Parameters:
        schema - the schema to apply
        properties - the store properties to apply
      • getMap

        <K,​V> Map<K,​V> getMap​(String mapName,
                                          Class<K> keyClass,
                                          Class<V> valueClass)
        Retrieve a named Map. If the requested map does not exist, a new map is created and cached.
        Type Parameters:
        K - the type of the map keys
        V - the type of the map values
        Parameters:
        mapName - the name of the map to retrieve
        keyClass - the class type to use for the map keys
        valueClass - the class type to use for the map values
        Returns:
        the requested Map object
      • getMultiMap

        <K,​V> MultiMap<K,​V> getMultiMap​(String mapName,
                                                    Class<K> keyClass,
                                                    Class<V> valueClass)
        Retrieve a named MultiMap. If the requested map does not exist, a new multi map is created and cached.
        Type Parameters:
        K - the type of the map keys
        V - the type of the map values
        Parameters:
        mapName - the name of the multi map to retrieve
        keyClass - the class type to use for the map keys
        valueClass - the class type to use for the map values
        Returns:
        the requested MultiMap object
      • 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 keys
        V - the type of the map values
        Parameters:
        map - the map to update
        key - the key to update the corresponding value for
        updatedValue - the updated value
      • clear

        void clear()
        Clear any currently configured Maps.
      • cloneElement

        Element cloneElement​(Element element,
                             Schema schema)
        Clone an element.
        Parameters:
        element - the element to clone
        schema - the relevant schema
        Returns:
        the cloned element