Class MapKeyValueAdapter

All Implemented Interfaces:
DisposableBean, KeyValueAdapter

public class MapKeyValueAdapter extends AbstractKeyValueAdapter
KeyValueAdapter implementation for Map.
Author:
Christoph Strobl, Derek Cochran, Marcel Overdijk
  • Constructor Details

  • Method Details

    • put

      public Object put(Object id, Object item, String keyspace)
      Description copied from interface: KeyValueAdapter
      Add object with given id to keyspace.
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      Returns:
      the item previously associated with the id.
    • contains

      public boolean contains(Object id, String keyspace)
      Description copied from interface: KeyValueAdapter
      Check if a object with given id exists in keyspace.
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      Returns:
      true if item of type with id exists.
    • count

      public long count(String keyspace)
      Description copied from interface: KeyValueAdapter
      Count number of objects within keyspace.
      Parameters:
      keyspace - must not be null.
      Returns:
    • get

      public Object get(Object id, String keyspace)
      Description copied from interface: KeyValueAdapter
      Get the object with given id from keyspace.
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      Returns:
      null in case no matching item exists.
    • delete

      public Object delete(Object id, String keyspace)
      Description copied from interface: KeyValueAdapter
      Delete and return the object with given type and id.
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      Returns:
      null if object could not be found
    • getAllOf

      public Collection<?> getAllOf(String keyspace)
      Description copied from interface: KeyValueAdapter
      Get all elements for given keyspace.
      Parameters:
      keyspace - must not be null.
      Returns:
      empty Collection if nothing found.
    • entries

      public CloseableIterator<Map.Entry<Object,Object>> entries(String keyspace)
      Description copied from interface: KeyValueAdapter
      Returns a CloseableIterator that iterates over all entries.
      Parameters:
      keyspace - must not be null.
      Returns:
    • deleteAllOf

      public void deleteAllOf(String keyspace)
      Description copied from interface: KeyValueAdapter
      Remove all objects of given type.
      Parameters:
      keyspace - must not be null.
    • clear

      public void clear()
      Description copied from interface: KeyValueAdapter
      Removes all objects.
    • destroy

      public void destroy() throws Exception
      Throws:
      Exception
    • getKeySpaceMap

      protected Map<Object,Object> getKeySpaceMap(String keyspace)
      Get map associated with given key space.
      Parameters:
      keyspace - must not be null.
      Returns: