public class MapKeyValueAdapter extends AbstractKeyValueAdapter
KeyValueAdapter
implementation for Map
.Constructor and Description |
---|
MapKeyValueAdapter()
Create new
MapKeyValueAdapter using ConcurrentHashMap as backing store type. |
MapKeyValueAdapter(Class<? extends Map> mapType)
Creates a new
MapKeyValueAdapter using the given Map as backing store. |
MapKeyValueAdapter(Class<? extends Map> mapType,
QueryEngine<? extends KeyValueAdapter,?,?> engine)
Creates a new
MapKeyValueAdapter using the given Map as backing store and query engine. |
MapKeyValueAdapter(Map<String,Map<Object,Object>> store)
Create new instance of
MapKeyValueAdapter using given dataStore for persistence. |
MapKeyValueAdapter(Map<String,Map<Object,Object>> store,
QueryEngine<? extends KeyValueAdapter,?,?> engine)
Create new instance of
MapKeyValueAdapter using given dataStore for persistence and query engine. |
MapKeyValueAdapter(QueryEngine<? extends KeyValueAdapter,?,?> engine)
Create new
MapKeyValueAdapter using the given query engine. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all objects.
|
boolean |
contains(Object id,
String keyspace)
Check if a object with given id exists in keyspace.
|
long |
count(String keyspace)
Count number of objects within keyspace.
|
Object |
delete(Object id,
String keyspace)
Delete and return the object with given type and id.
|
void |
deleteAllOf(String keyspace)
Remove all objects of given type.
|
void |
destroy() |
CloseableIterator<Map.Entry<Object,Object>> |
entries(String keyspace)
Returns a
CloseableIterator that iterates over all entries. |
Object |
get(Object id,
String keyspace)
Get the object with given id from keyspace.
|
Collection<?> |
getAllOf(String keyspace)
Get all elements for given keyspace.
|
protected Map<Object,Object> |
getKeySpaceMap(String keyspace)
Get map associated with given key space.
|
Object |
put(Object id,
Object item,
String keyspace)
Add object with given id to keyspace.
|
count, delete, find, find, get, getQueryEngine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
entries, getAllOf
public MapKeyValueAdapter()
MapKeyValueAdapter
using ConcurrentHashMap
as backing store type.public MapKeyValueAdapter(QueryEngine<? extends KeyValueAdapter,?,?> engine)
MapKeyValueAdapter
using the given query engine.engine
- the query engine.public MapKeyValueAdapter(Class<? extends Map> mapType)
MapKeyValueAdapter
using the given Map
as backing store.mapType
- must not be null.public MapKeyValueAdapter(Class<? extends Map> mapType, QueryEngine<? extends KeyValueAdapter,?,?> engine)
MapKeyValueAdapter
using the given Map
as backing store and query engine.mapType
- must not be null.engine
- the query engine.public MapKeyValueAdapter(Map<String,Map<Object,Object>> store)
MapKeyValueAdapter
using given dataStore for persistence.store
- must not be null.public MapKeyValueAdapter(Map<String,Map<Object,Object>> store, QueryEngine<? extends KeyValueAdapter,?,?> engine)
MapKeyValueAdapter
using given dataStore for persistence and query engine.store
- must not be null.engine
- the query engine.public Object put(Object id, Object item, String keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public boolean contains(Object id, String keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public long count(String keyspace)
KeyValueAdapter
keyspace
- must not be null.public Object get(Object id, String keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public Object delete(Object id, String keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public Collection<?> getAllOf(String keyspace)
KeyValueAdapter
keyspace
- must not be null.Collection
if nothing found.public CloseableIterator<Map.Entry<Object,Object>> entries(String keyspace)
KeyValueAdapter
CloseableIterator
that iterates over all entries.keyspace
- must not be null.public void deleteAllOf(String keyspace)
KeyValueAdapter
keyspace
- must not be null.public void clear()
KeyValueAdapter
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.