public interface Cache
This cache can not hold null key or value.
| 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.
|
String |
getName()
Gets the name of this cache.
|
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.
|
void |
setName(String name)
Sets the name of this cache with the specified name.
|
void setName(String name)
name - the specified nameString getName()
boolean contains(String key)
key - the given keytrue if it is in cache, returns false otherwisevoid put(String key, JSONObject value)
Throws IllegalArgumentException if the specified key or value is null.
key - the key of the specified objectvalue - the specified objectJSONObject get(String key)
Returns null if the specified key is null.
key - the specified keynullvoid remove(String key)
key - the specified keyvoid remove(Collection<String> keys)
keys - the specified keysvoid clear()
Copyright © 2009–2019 B3log. All rights reserved.