public class CaffeineCacheService extends java.lang.Object implements CacheService
构造器和说明 |
---|
CaffeineCacheService(com.github.benmanes.caffeine.cache.Cache<java.lang.String,java.lang.Object> client,
int defSeconds) |
CaffeineCacheService(com.github.benmanes.caffeine.cache.Cache<java.lang.String,java.lang.Object> client,
java.lang.String keyHeader,
int defSeconds) |
CaffeineCacheService(java.util.Properties prop) |
CaffeineCacheService(java.util.Properties prop,
java.lang.String keyHeader,
int defSeconds) |
限定符和类型 | 方法和说明 |
---|---|
<T> T |
get(java.lang.String key,
java.lang.reflect.Type type)
获取
|
<T> T |
getOrStore(java.lang.String key,
java.lang.reflect.Type type,
int seconds,
java.util.function.Supplier<T> supplier)
获取或者存储
|
void |
remove(java.lang.String key)
移除
|
void |
store(java.lang.String key,
java.lang.Object obj,
int seconds)
保存
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public CaffeineCacheService(com.github.benmanes.caffeine.cache.Cache<java.lang.String,java.lang.Object> client, int defSeconds)
public CaffeineCacheService(com.github.benmanes.caffeine.cache.Cache<java.lang.String,java.lang.Object> client, java.lang.String keyHeader, int defSeconds)
public CaffeineCacheService(java.util.Properties prop)
public CaffeineCacheService(java.util.Properties prop, java.lang.String keyHeader, int defSeconds)
public void store(java.lang.String key, java.lang.Object obj, int seconds)
CacheService
store
在接口中 CacheService
key
- 缓存键obj
- 对象seconds
- 秒数public void remove(java.lang.String key)
CacheService
remove
在接口中 CacheService
key
- 缓存键public <T> T get(java.lang.String key, java.lang.reflect.Type type)
CacheService
get
在接口中 CacheService
key
- 缓存键public <T> T getOrStore(java.lang.String key, java.lang.reflect.Type type, int seconds, java.util.function.Supplier<T> supplier)
CacheService
getOrStore
在接口中 CacheService