public interface Cache
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String id)
Do we have this object in the cache?
|
boolean |
contains(String appid,
String id)
Do we have this object in the cache?
|
<T> T |
get(String id)
Read an object from cache.
|
<T> T |
get(String appid,
String id)
Read an object from cache.
|
<T> Map<String,T> |
getAll(List<String> ids)
Read a number of objects given a list of their ids.
|
<T> Map<String,T> |
getAll(String appid,
List<String> ids)
Read a number of objects given a list of their ids.
|
<T> void |
put(String appid,
String id,
T object)
Store an object in the cache.
|
<T> void |
put(String appid,
String id,
T object,
Long ttlSeconds)
Store an object in the cache.
|
<T> void |
put(String id,
T object)
Store an object in the cache.
|
<T> void |
putAll(Map<String,T> objects)
Store all objects in cache, except those which are null.
|
<T> void |
putAll(String appid,
Map<String,T> objects)
Store all objects in cache, except those which are null.
|
void |
remove(String id)
Remove an object from cache.
|
void |
remove(String appid,
String id)
Remove an object from cache.
|
void |
removeAll()
Clears the cache.
|
void |
removeAll(List<String> ids)
Remove a number of objects from cache given a list of their ids.
|
void |
removeAll(String appid)
Clears the cache.
|
void |
removeAll(String appid,
List<String> ids)
Remove a number of objects from cache given a list of their ids.
|
boolean contains(String id)
id - the object's idboolean contains(String appid, String id)
appid - the name of the applicationid - the object's idcontains(java.lang.String)<T> void put(String id, T object)
T - the type of object to be cachedid - the object's id, not null or emptyobject - the object itself, not null<T> void put(String appid, String id, T object)
T - the type of object to be cachedappid - the name of the applicationid - the object's id, not null or emptyobject - the object itself, not nullput(java.lang.String, java.lang.Object)<T> void put(String appid, String id, T object, Long ttlSeconds)
T - the type of object to be cachedappid - the name of the applicationid - the object's id, not null or emptyobject - the object itself, not nullttlSeconds - the time to live for an object before it is evicted from the cache.put(java.lang.String, java.lang.Object)<T> void putAll(Map<String,T> objects)
T - any object, not nullobjects - map of id - object<T> void putAll(String appid, Map<String,T> objects)
T - any object, not nullappid - the name of the applicationobjects - map of id - objectputAll(java.util.Map)<T> T get(String id)
T - the type of object to be cachedid - the object's id, not null or empty<T> T get(String appid, String id)
T - the type of object to be cachedappid - the name of the applicationid - the object's id, not null or emptyget(java.lang.String)<T> Map<String,T> getAll(List<String> ids)
T - the type of object to be cachedids - the ids, not null or empty<T> Map<String,T> getAll(String appid, List<String> ids)
T - the type of object to be cachedappid - the name of the applicationids - the ids, not null or emptygetAll(java.util.List)void remove(String id)
id - the object's id, not null or emptyvoid remove(String appid, String id)
appid - the name of the applicationid - the object's id, not null or emptyremove(java.lang.String)void removeAll()
void removeAll(String appid)
appid - the name of the applicationremoveAll()void removeAll(List<String> ids)
ids - the ids, not null or emptyvoid removeAll(String appid, List<String> ids)
ids - the ids, not null or emptyappid - the name of the applicationremoveAll(java.util.List)Copyright © 2016 Erudika. All rights reserved.