public interface ObjectCache
Dao.setObjectCache(ObjectCache)
.
NOTE: Most of the below methods take a Class argument but your cache can be for a single cache. If this is the case then you should protect against storing different classes in the cache.
Modifier and Type | Method and Description |
---|---|
<T> void |
clear(Class<T> clazz)
Remove all entries from the cache of a certain class.
|
void |
clearAll()
Remove all entries from the cache of all classes.
|
<T,ID> T |
get(Class<T> clazz,
ID id)
Lookup in the cache for an object of a certain class that has a certain id.
|
<T,ID> void |
put(Class<T> clazz,
ID id,
T data)
Put an object in the cache that has a certain class and id.
|
<T> void |
registerClass(Class<T> clazz)
Register a class for use with this class.
|
<T,ID> void |
remove(Class<T> clazz,
ID id)
Delete from the cache an object of a certain class that has a certain id.
|
<T> int |
size(Class<T> clazz)
Return the number of elements in the cache.
|
int |
sizeAll()
Return the number of elements in all of the caches.
|
<T,ID> T |
updateId(Class<T> clazz,
ID oldId,
ID newId)
Change the id in the cache for an object of a certain class from an old-id to a new-id.
|
<T> void registerClass(Class<T> clazz)
<T,ID> T get(Class<T> clazz, ID id)
<T,ID> void put(Class<T> clazz, ID id, T data)
<T,ID> void remove(Class<T> clazz, ID id)
<T,ID> T updateId(Class<T> clazz, ID oldId, ID newId)
<T> void clear(Class<T> clazz)
void clearAll()
<T> int size(Class<T> clazz)
int sizeAll()
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.