| Constructor and Description |
|---|
MockCache() |
| 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.
|
public boolean contains(String appid, String id)
Cachecontains in interface Cacheappid - the name of the applicationid - the object's idCache.contains(java.lang.String)public <T> void put(String appid, String id, T object)
Cacheput in interface CacheT - the type of object to be cachedappid - the name of the applicationid - the object's id, not null or emptyobject - the object itself, not nullCache.put(java.lang.String, java.lang.Object)public <T> void put(String appid, String id, T object, Long ttlSeconds)
Cacheput in interface CacheT - 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.Cache.put(java.lang.String, java.lang.Object)public <T> void putAll(String appid, Map<String,T> objects)
CacheputAll in interface CacheT - any object, not nullappid - the name of the applicationobjects - map of id - objectCache.putAll(java.util.Map)public <T> T get(String appid, String id)
Cacheget in interface CacheT - the type of object to be cachedappid - the name of the applicationid - the object's id, not null or emptyCache.get(java.lang.String)public <T> Map<String,T> getAll(String appid, List<String> ids)
CachegetAll in interface CacheT - the type of object to be cachedappid - the name of the applicationids - the ids, not null or emptyCache.getAll(java.util.List)public void remove(String appid, String id)
Cacheremove in interface Cacheappid - the name of the applicationid - the object's id, not null or emptyCache.remove(java.lang.String)public void removeAll(String appid)
CacheremoveAll in interface Cacheappid - the name of the applicationCache.removeAll()public void removeAll(String appid, List<String> ids)
CacheremoveAll in interface Cacheappid - the name of the applicationids - the ids, not null or emptyCache.removeAll(java.util.List)public boolean contains(String id)
Cachepublic <T> void put(String id, T object)
Cachepublic <T> void putAll(Map<String,T> objects)
Cachepublic <T> Map<String,T> getAll(List<String> ids)
Cachepublic void remove(String id)
Cachepublic void removeAll()
CacheCopyright © 2018 Erudika. All rights reserved.