public final class RedisCache extends AbstractCache
EXPIRE_SECONDS| Constructor and Description |
|---|
RedisCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all cached objects.
|
boolean |
contains(String key)
Checks whether an object specified by the given key is in cache.
|
JSONObject |
get(String key)
Gets a object by the specified key.
|
void |
put(String key,
JSONObject value)
Puts the specified object into this cache.
|
void |
remove(Collection<String> keys)
Remove objects by the specified keys.
|
void |
remove(String key)
Removes a object by the specified key.
|
static void |
shutdown()
Shutdowns redis cache.
|
getName, setNamepublic boolean contains(String key)
Cachekey - the given keytrue if it is in cache, returns false otherwisepublic void put(String key, JSONObject value)
Cache
Throws IllegalArgumentException if the specified key or value is null.
key - the key of the specified objectvalue - the specified objectpublic JSONObject get(String key)
Cache
Returns null if the specified key is null.
key - the specified keynullpublic void remove(String key)
Cachekey - the specified keypublic void remove(Collection<String> keys)
Cachekeys - the specified keyspublic void clear()
Cachepublic static void shutdown()
Copyright © 2009–2019 B3log. All rights reserved.