SyncCacheApi
or AsyncCacheApi
.@Deprecated
public interface CacheApi
Modifier and Type | Method and Description |
---|---|
<T> T |
get(java.lang.String key)
Deprecated.
Retrieves an object by key.
|
<T> T |
getOrElse(java.lang.String key,
java.util.concurrent.Callable<T> block)
Deprecated.
Retrieve a value from the cache, or set it from a default Callable function.
|
<T> T |
getOrElse(java.lang.String key,
java.util.concurrent.Callable<T> block,
int expiration)
Deprecated.
Retrieve a value from the cache, or set it from a default Callable function.
|
void |
remove(java.lang.String key)
Deprecated.
Removes a value from the cache.
|
void |
set(java.lang.String key,
java.lang.Object value)
Deprecated.
Sets a value without expiration.
|
void |
set(java.lang.String key,
java.lang.Object value,
int expiration)
Deprecated.
Sets a value with expiration.
|
<T> T get(java.lang.String key)
T
- the type of the stored objectkey
- the key to look up<T> T getOrElse(java.lang.String key, java.util.concurrent.Callable<T> block, int expiration)
T
- the type of the valuekey
- Item key.block
- block returning value to set if key does not existexpiration
- expiration period in seconds.<T> T getOrElse(java.lang.String key, java.util.concurrent.Callable<T> block)
The value has no expiration.
T
- the type of the valuekey
- Item key.block
- block returning value to set if key does not existvoid set(java.lang.String key, java.lang.Object value, int expiration)
key
- Item key.value
- The value to set.expiration
- expiration in secondsvoid set(java.lang.String key, java.lang.Object value)
key
- Item key.value
- The value to set.void remove(java.lang.String key)
key
- The key to remove the value for.