public class CacheManagerImpl extends Object implements ICacheManager
Constructor and Description |
---|
CacheManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clearAll()
清除所有缓存
|
void |
clearByKey(String key)
清除对应缓存
|
Set<String> |
getAllKeys()
获取所有key
|
Map<String,EntityCache> |
getCacheAll()
获取所有缓存
|
EntityCache |
getCacheByKey(String key)
获取对应缓存
|
Object |
getCacheDataByKey(String key)
获取对应缓存
|
boolean |
isContains(String key)
判断是否在缓存中
|
boolean |
isTimeOut(String key)
缓存是否超时失效
|
void |
putCache(String key,
EntityCache cache)
存入缓存
|
void |
putCache(String key,
Object datas,
long timeOut)
存入缓存
|
public void putCache(String key, EntityCache cache)
putCache
in interface ICacheManager
key
- 键cache
- cache对象public void putCache(String key, Object datas, long timeOut)
putCache
in interface ICacheManager
key
- 键datas
- 输入数据timeOut
- 过期时间 单位:毫秒public EntityCache getCacheByKey(String key)
getCacheByKey
in interface ICacheManager
key
- 键public Object getCacheDataByKey(String key)
getCacheDataByKey
in interface ICacheManager
key
- 键public Map<String,EntityCache> getCacheAll()
getCacheAll
in interface ICacheManager
public boolean isContains(String key)
isContains
in interface ICacheManager
key
- 键public void clearAll()
clearAll
in interface ICacheManager
public void clearByKey(String key)
clearByKey
in interface ICacheManager
key
- 键public boolean isTimeOut(String key)
isTimeOut
in interface ICacheManager
key
- 键public Set<String> getAllKeys()
getAllKeys
in interface ICacheManager
Copyright © 2020. All rights reserved.