public interface KeyValueAdapter extends DisposableBean
KeyValueAdapter
unifies access and shields the underlying key/value specific implementation.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(KeyValueQuery<?> query,
String keyspace)
Count all matching objects within 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.
|
<T> T |
delete(Object id,
String keyspace,
Class<T> type)
Delete and return the object with given type and id.
|
void |
deleteAllOf(String keyspace)
Remove all objects of given type.
|
CloseableIterator<Map.Entry<Object,Object>> |
entries(String keyspace)
Returns a
CloseableIterator that iterates over all entries. |
default <T> CloseableIterator<Map.Entry<Object,T>> |
entries(String keyspace,
Class<T> type)
Returns a
CloseableIterator that iterates over all entries. |
default Iterable<?> |
find(KeyValueQuery<?> query,
String keyspace)
Find all matching objects within keyspace.
|
<T> Iterable<T> |
find(KeyValueQuery<?> query,
String keyspace,
Class<T> type) |
Object |
get(Object id,
String keyspace)
Get the object with given id from keyspace.
|
<T> T |
get(Object id,
String keyspace,
Class<T> type)
Get the object with given id from keyspace.
|
Iterable<?> |
getAllOf(String keyspace)
Get all elements for given keyspace.
|
default <T> Iterable<T> |
getAllOf(String keyspace,
Class<T> type)
Get all elements for given keyspace.
|
Object |
put(Object id,
Object item,
String keyspace)
Add object with given id to keyspace.
|
destroy
Object put(Object id, Object item, String keyspace)
id
- must not be null.keyspace
- must not be null.boolean contains(Object id, String keyspace)
id
- must not be null.keyspace
- must not be null.@Nullable Object get(Object id, String keyspace)
id
- must not be null.keyspace
- must not be null.@Nullable <T> T get(Object id, String keyspace, Class<T> type)
id
- must not be null.keyspace
- must not be null.type
- must not be null.@Nullable Object delete(Object id, String keyspace)
id
- must not be null.keyspace
- must not be null.@Nullable <T> T delete(Object id, String keyspace, Class<T> type)
id
- must not be null.keyspace
- must not be null.type
- must not be null.Iterable<?> getAllOf(String keyspace)
keyspace
- must not be null.Collection
if nothing found.default <T> Iterable<T> getAllOf(String keyspace, Class<T> type)
keyspace
- must not be null.type
- must not be null.Collection
if nothing found.CloseableIterator<Map.Entry<Object,Object>> entries(String keyspace)
CloseableIterator
that iterates over all entries.keyspace
- must not be null.default <T> CloseableIterator<Map.Entry<Object,T>> entries(String keyspace, Class<T> type)
CloseableIterator
that iterates over all entries.keyspace
- must not be null.type
- must not be null.void deleteAllOf(String keyspace)
keyspace
- must not be null.void clear()
default Iterable<?> find(KeyValueQuery<?> query, String keyspace)
query
- must not be null.keyspace
- must not be null.Collection
if no match found.<T> Iterable<T> find(KeyValueQuery<?> query, String keyspace, Class<T> type)
query
- must not be null.keyspace
- must not be null.type
- must not be null.Collection
if no match found.long count(String keyspace)
keyspace
- must not be null.long count(KeyValueQuery<?> query, String keyspace)
query
- must not be null.keyspace
- must not be null.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.