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(Map<Serializable,Map<Serializable,Object>> store)
Create new instance of
MapKeyValueAdapter using given dataStore for persistence. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all objects.
|
boolean |
contains(Serializable id,
Serializable keyspace)
Check if a object with given id exists in keyspace.
|
long |
count(Serializable keyspace)
Count number of objects within keyspace.
|
Object |
delete(Serializable id,
Serializable keyspace)
Delete and return the obect with given type and id.
|
void |
deleteAllOf(Serializable keyspace)
Remove all objects of given type.
|
void |
destroy() |
CloseableIterator<Map.Entry<Serializable,Object>> |
entries(Serializable keyspace)
Returns a
KeyValueIterator that iterates over all entries. |
Object |
get(Serializable id,
Serializable keyspace)
Get the object with given id from keyspace.
|
Collection<?> |
getAllOf(Serializable keyspace)
Get all elements for given keyspace.
|
protected Map<Serializable,Object> |
getKeySpaceMap(Serializable keyspace)
Get map associated with given key space.
|
Object |
put(Serializable id,
Object item,
Serializable keyspace)
Add object with given id to keyspace.
|
count, find, getQueryEngine
public MapKeyValueAdapter()
MapKeyValueAdapter
using ConcurrentHashMap
as backing store type.public MapKeyValueAdapter(Class<? extends Map> mapType)
MapKeyValueAdapter
using the given Map
as backing store.mapType
- must not be null.public MapKeyValueAdapter(Map<Serializable,Map<Serializable,Object>> store)
MapKeyValueAdapter
using given dataStore for persistence.store
- must not be null.public Object put(Serializable id, Object item, Serializable keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public boolean contains(Serializable id, Serializable keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public long count(Serializable keyspace)
KeyValueAdapter
keyspace
- must not be null.public Object get(Serializable id, Serializable keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public Object delete(Serializable id, Serializable keyspace)
KeyValueAdapter
id
- must not be null.keyspace
- must not be null.public Collection<?> getAllOf(Serializable keyspace)
KeyValueAdapter
keyspace
- must not be null.Collection
if nothing found.public CloseableIterator<Map.Entry<Serializable,Object>> entries(Serializable keyspace)
KeyValueAdapter
KeyValueIterator
that iterates over all entries.public void deleteAllOf(Serializable keyspace)
KeyValueAdapter
keyspace
- must not be null.public void clear()
KeyValueAdapter
protected Map<Serializable,Object> getKeySpaceMap(Serializable keyspace)
keyspace
- must not be null.Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.