Interface KeyValueAdapter
- All Superinterfaces:
DisposableBean
- All Known Implementing Classes:
AbstractKeyValueAdapter, MapKeyValueAdapter
KeyValueAdapter unifies access and shields the underlying key/value specific implementation.- Author:
- Christoph Strobl, Thomas Darimont, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all objects.booleanCheck if a object with given id exists in keyspace.longCount number of objects within keyspace.longcount(KeyValueQuery<?> query, String keyspace) Count all matching objects within keyspace.@Nullable ObjectDelete and return the object with given type and id.<T> @Nullable TDelete and return the object with given type and id.voiddeleteAllOf(String keyspace) Remove all objects of given type.Returns aCloseableIteratorthat iterates over all entries.default <T> CloseableIterator<Map.Entry<Object, T>> Returns aCloseableIteratorthat iterates over all entries.default booleanexists(KeyValueQuery<?> query, String keyspace) Determine whether result of givenKeyValueQuerywithin keyspace contains at least one element.default Iterable<?> find(KeyValueQuery<?> query, String keyspace) Find all matching objects within keyspace.<T> Iterable<T> find(KeyValueQuery<?> query, String keyspace, Class<T> type) @Nullable ObjectGet the object with given id from keyspace.<T> @Nullable TGet the object with given id from keyspace.Get all elements for given keyspace.default <T> Iterable<T> Get all elements for given keyspace.@Nullable ObjectAdd object with given id to keyspace.Methods inherited from interface DisposableBean
destroy
-
Method Details
-
put
-
contains
-
get
-
get
-
delete
-
delete
-
getAllOf
Get all elements for given keyspace.- Parameters:
keyspace- must not be null.- Returns:
- empty
Collectionif nothing found.
-
getAllOf
Get all elements for given keyspace.- Parameters:
keyspace- must not be null.type- must not be null.- Returns:
- empty
Collectionif nothing found. - Since:
- 2.5
-
entries
Returns aCloseableIteratorthat iterates over all entries.- Parameters:
keyspace- must not be null.- Returns:
-
entries
Returns aCloseableIteratorthat iterates over all entries.- Parameters:
keyspace- must not be null.type- must not be null.- Returns:
- Since:
- 2.5
-
deleteAllOf
Remove all objects of given type.- Parameters:
keyspace- must not be null.
-
clear
void clear()Removes all objects. -
find
Find all matching objects within keyspace.- Parameters:
query- must not be null.keyspace- must not be null.- Returns:
- empty
Collectionif no match found.
-
find
- Parameters:
query- must not be null.keyspace- must not be null.type- must not be null.- Returns:
- empty
Collectionif no match found. - Since:
- 1.1
-
count
Count number of objects within keyspace.- Parameters:
keyspace- must not be null.- Returns:
-
count
Count all matching objects within keyspace.- Parameters:
query- must not be null.keyspace- must not be null.- Returns:
-
exists
Determine whether result of givenKeyValueQuerywithin keyspace contains at least one element.- Parameters:
query- must not be null.keyspace- must not be null.- Returns:
- Since:
- 2.7
-