public interface DataStore<K extends Serializable,E>
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(K key)
Deletes the entity identifiable with the provided key, or does nothing if no such entity exists.
|
Class<E> |
getEntityType() |
boolean |
hasKey(K key)
Determines whether or not an entity with the given key exists in the data store.
|
Collection<K> |
keys() |
E |
retrieve(K key)
Given a key, retrieves the entity associated with that key in the data store.
|
Collection<E> |
retrieveAll() |
boolean |
save(K key,
E entity)
Saves the given entity into the data store under the provided key.
|
void |
truncate()
Does a hard remove of all the entities in the data store
|
boolean hasKey(K key)
key - the keyboolean save(K key, E entity)
hasKey(Serializable) should yield true
and the very same entity (or an equal value entity) can be retrieved by calling retrieve(Serializable).key - the keyentity - the entityboolean delete(K key)
hasKey(Serializable) should return
false and retrieve(Serializable) should return null for the same key.key - the key for which the removal should happenE retrieve(K key)
key - the keyCollection<K> keys()
Collection<E> retrieveAll()
void truncate()
Copyright © 2014–2016. All rights reserved.