- java.lang.Object
-
- org.redkale.cached.spi.CachedManagerService
-
- 所有已实现的接口:
CachedManager
,CachedActionFunc
,Resourcable
,Service
@Local @Component @AutoLoad(false) @ResourceType(CachedManager.class) public class CachedManagerService extends Object implements CachedManager, CachedActionFunc, Service
缓存管理器详情见: https://redkale.org
- 从以下版本开始:
- 2.8.0
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 class
CachedManagerService.CacheRemoteListener
protected static interface
CachedManagerService.GetterFunc<R>
protected static interface
CachedManagerService.SetterAsyncFunc
protected static interface
CachedManagerService.SetterSyncFunc
-
字段概要
字段 修饰符和类型 字段 说明 protected List<CachedAction>
actions
protected Application
application
protected ConcurrentHashMap<String,CachedAsyncLock>
asyncLockMap
protected boolean
broadcastable
protected AnyValue
config
protected boolean
enabled
protected CachedLocalSource
localSource
protected Logger
logger
protected Level
logLevel
protected String
name
protected String
node
protected CacheEventListener
remoteListener
protected CacheSource
remoteSource
protected String
schema
protected ConcurrentHashMap<String,CachedValue>
syncLockMap
-
从接口继承的字段 org.redkale.cached.CachedManager
CACHED_SCHEMA, CACHED_TOPIC
-
-
构造器概要
构造器 限定符 构造器 说明 protected
CachedManagerService(CacheSource remoteSource)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
acceptCachedAction(String name, Consumer<CachedAction> consumer)
处理指定缓存名称的CachedAction
void
addAction(CachedAction action)
long
bothDel(String name, String key)
远程删除缓存数据CompletableFuture<Long>
bothDelAsync(String name, String key)
远程异步删除缓存数据<T> T
bothGet(String name, String key, Type type)
远程获取缓存数据, 过期返回null<T> CompletableFuture<T>
bothGetAsync(String name, String key, Type type)
远程异步获取缓存数据, 过期返回nullprotected <T> CachedValue<T>
bothGetCache(String name, String key, int localLimit, Duration expire, Type cacheType)
protected <T> CompletableFuture<CachedValue<T>>
bothGetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType)
远程异步获取缓存数据, 过期返回null<T> T
bothGetSet(String name, String key, Type type, boolean nullable, int localLimit, Duration localExpire, Duration remoteExpire, ThrowSupplier<T> supplier)
远程获取缓存数据, 过期返回null<T> CompletableFuture<T>
bothGetSetAsync(String name, String key, Type type, boolean nullable, int localLimit, Duration localExpire, Duration remoteExpire, ThrowSupplier<CompletableFuture<T>> supplier)
远程异步获取缓存数据, 过期返回null<T> void
bothSet(String name, String key, Type type, T value, Duration localExpire, Duration remoteExpire)
远程缓存数据<T> CompletableFuture<Void>
bothSetAsync(String name, String key, Type type, T value, Duration localExpire, Duration remoteExpire)
远程异步缓存数据protected void
checkEnable()
protected String
checkSchema(String value)
检查schema是否含特殊字符static CachedManagerService
create(CacheSource remoteSource)
void
destroy(AnyValue conf)
进程退出时,调用Service销毁 远程模式下该方法会重载成空方法 注意: 在此方法内不能调用MessageClient.sendMessage 方法,因为Application关闭时会先destroy掉MessageClientboolean
enabled()
CachedManagerService
enabled(boolean val)
List<CachedAction>
getCachedActions()
获取CachedAction
集合CachedLocalSource
getLocalSource()
String
getNode()
唯一标识CacheSource
getRemoteSource()
获取远程缓存Source, 可能为nullString
getSchema()
缓存的schema, 不能含有':'、'#'、'@'字符protected <T> T
getSet(CachedManagerService.GetterFunc<CachedValue<T>> getter, CachedManagerService.SetterSyncFunc setter, String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<T> supplier)
获取缓存数据, 过期返回nullprotected <T> CompletableFuture<T>
getSetAsync(CachedManagerService.GetterFunc<CompletableFuture<CachedValue<T>>> getter, CachedManagerService.SetterAsyncFunc setter, String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
异步获取缓存数据, 过期返回nullprotected String
idFor(String name, String key)
创建一个锁keyvoid
init(AnyValue conf)
该方法必须是可以重复调用, 当reload时需要重复调用init方法 远程模式下该方法会重载成空方法boolean
isEnabled()
protected Type
loadCacheType(Type type)
创建数据类型创建对应CacheValue泛型protected Type
loadCacheType(Type type, Object value)
创建数据类型创建对应CacheValue泛型long
localDel(String name, String key)
本地删除缓存数据<T> T
localGet(String name, String key, Type type)
本地获取缓存数据, 过期返回null<T> T
localGetSet(String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<T> supplier)
本地获取缓存数据, 过期返回null<T> CompletableFuture<T>
localGetSetAsync(String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
本地异步获取缓存数据, 过期返回null<T> void
localSet(String name, String key, int localLimit, Type type, T value, Duration expire)
本地缓存数据protected <T> void
localSetCache(String name, String key, int localLimit, Type type, T value, Duration expire)
protected <T> void
localSetCache(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
protected <T> CompletableFuture<Void>
localSetCacheAsync(String name, String key, int localLimit, Type type, T value, Duration expire)
protected <T> CompletableFuture<Void>
localSetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
long
remoteDel(String name, String key)
远程删除缓存数据CompletableFuture<Long>
remoteDelAsync(String name, String key)
远程异步删除缓存数据<T> T
remoteGet(String name, String key, Type type)
远程获取缓存数据, 过期返回null<T> CompletableFuture<T>
remoteGetAsync(String name, String key, Type type)
远程异步获取缓存数据, 过期返回null<T> T
remoteGetSet(String name, String key, Type type, boolean nullable, Duration expire, ThrowSupplier<T> supplier)
远程获取缓存数据, 过期返回null<T> CompletableFuture<T>
remoteGetSetAsync(String name, String key, Type type, boolean nullable, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
远程异步获取缓存数据, 过期返回null<T> void
remoteSet(String name, String key, Type type, T value, Duration expire)
远程缓存数据<T> CompletableFuture<Void>
remoteSetAsync(String name, String key, Type type, T value, Duration expire)
远程异步缓存数据protected <T> void
remoteSetCache(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
protected <T> void
remoteSetCache(String name, String key, Type type, T value, Duration expire)
protected <T> void
remoteSetCache(String name, String key, Duration expire, Type cacheType, CachedValue<T> cacheVal)
protected <T> CompletableFuture<Void>
remoteSetCacheAsync(String name, String key, int localLimit, Type type, T value, Duration expire)
protected <T> CompletableFuture<Void>
remoteSetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
protected <T> CompletableFuture<Void>
remoteSetCacheAsync(String name, String key, Duration expire, Type cacheType, CachedValue<T> cacheVal)
String
resourceName()
资源名称void
setSchema(String schema)
protected <T> ThrowSupplier<CachedValue<T>>
toCacheSupplier(boolean nullable, ThrowSupplier<T> supplier)
将原始数据函数转换成获取CacheValue数据函数protected <T> CachedValue<T>
toCacheValue(boolean nullable, T value)
将原始数据函数转换成获取CacheValue数据函数String
toString()
void
updateBroadcastable(boolean broadcastable)
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 org.redkale.cached.CachedManager
bothGetString, bothGetStringAsync, bothSetString, bothSetStringAsync, getChannelTopic, localGetString, localSet, localSetString, localSetString, remoteGetString, remoteGetStringAsync, remoteSetString, remoteSetStringAsync
-
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
logLevel
protected Level logLevel
-
node
protected final String node
-
name
protected String name
-
schema
protected String schema
-
enabled
protected boolean enabled
-
broadcastable
protected boolean broadcastable
-
config
protected AnyValue config
-
localSource
protected final CachedLocalSource localSource
-
syncLockMap
protected final ConcurrentHashMap<String,CachedValue> syncLockMap
-
asyncLockMap
protected final ConcurrentHashMap<String,CachedAsyncLock> asyncLockMap
-
actions
protected final List<CachedAction> actions
-
application
protected Application application
-
remoteSource
protected CacheSource remoteSource
-
remoteListener
protected CacheEventListener remoteListener
-
-
构造器详细资料
-
CachedManagerService
protected CachedManagerService(@Nullable CacheSource remoteSource)
-
-
方法详细资料
-
create
public static CachedManagerService create(@Nullable CacheSource remoteSource)
-
enabled
public boolean enabled()
-
enabled
public CachedManagerService enabled(boolean val)
-
init
public void init(AnyValue conf)
从接口复制的说明:Service
该方法必须是可以重复调用, 当reload时需要重复调用init方法 远程模式下该方法会重载成空方法
-
destroy
public void destroy(AnyValue conf)
从接口复制的说明:Service
进程退出时,调用Service销毁 远程模式下该方法会重载成空方法 注意: 在此方法内不能调用MessageClient.sendMessage 方法,因为Application关闭时会先destroy掉MessageClient
-
resourceName
public String resourceName()
从接口复制的说明:CachedManager
资源名称- 指定者:
resourceName
在接口中CachedManager
- 指定者:
resourceName
在接口中Resourcable
- 返回:
- 名称
-
getNode
public String getNode()
从接口复制的说明:CachedManager
唯一标识- 指定者:
getNode
在接口中CachedManager
- 返回:
- node
-
getSchema
public String getSchema()
从接口复制的说明:CachedManager
缓存的schema, 不能含有':'、'#'、'@'字符- 指定者:
getSchema
在接口中CachedManager
- 返回:
- schema
-
setSchema
public void setSchema(String schema)
-
isEnabled
public boolean isEnabled()
-
updateBroadcastable
public void updateBroadcastable(boolean broadcastable)
-
getLocalSource
public CachedLocalSource getLocalSource()
-
getRemoteSource
public CacheSource getRemoteSource()
获取远程缓存Source, 可能为null- 指定者:
getRemoteSource
在接口中CachedManager
- 返回:
CacheSource
-
addAction
public void addAction(CachedAction action)
- 指定者:
addAction
在接口中CachedActionFunc
-
getCachedActions
public List<CachedAction> getCachedActions()
获取CachedAction
集合- 指定者:
getCachedActions
在接口中CachedManager
- 返回:
- CachedAction集合
-
acceptCachedAction
public void acceptCachedAction(String name, Consumer<CachedAction> consumer)
处理指定缓存名称的CachedAction
- 指定者:
acceptCachedAction
在接口中CachedManager
- 参数:
name
- 缓存名称consumer
- 处理函数
-
localGet
public <T> T localGet(String name, String key, Type type)
本地获取缓存数据, 过期返回null- 指定者:
localGet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型- 返回:
- 数据值
-
localGetSet
public <T> T localGetSet(String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<T> supplier)
本地获取缓存数据, 过期返回null- 指定者:
localGetSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
localGetSetAsync
public <T> CompletableFuture<T> localGetSetAsync(String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
本地异步获取缓存数据, 过期返回null- 指定者:
localGetSetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
localSet
public <T> void localSet(String name, String key, int localLimit, Type type, T value, Duration expire)
本地缓存数据- 指定者:
localSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键 *localLimit
- 本地缓存数量上限type
- 数据类型value
- 数据值expire
- 过期时长,Duration.ZERO为永不过期
-
localDel
public long localDel(String name, String key)
本地删除缓存数据- 指定者:
localDel
在接口中CachedManager
- 参数:
name
- 缓存名称key
- 缓存键- 返回:
- 删除数量
-
remoteGet
public <T> T remoteGet(String name, String key, Type type)
远程获取缓存数据, 过期返回null- 指定者:
remoteGet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型- 返回:
- 数据值
-
remoteGetAsync
public <T> CompletableFuture<T> remoteGetAsync(String name, String key, Type type)
远程异步获取缓存数据, 过期返回null- 指定者:
remoteGetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型- 返回:
- 数据值
-
remoteGetSet
public <T> T remoteGetSet(String name, String key, Type type, boolean nullable, Duration expire, ThrowSupplier<T> supplier)
远程获取缓存数据, 过期返回null- 指定者:
remoteGetSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
remoteGetSetAsync
public <T> CompletableFuture<T> remoteGetSetAsync(String name, String key, Type type, boolean nullable, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
远程异步获取缓存数据, 过期返回null- 指定者:
remoteGetSetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
remoteSet
public <T> void remoteSet(String name, String key, Type type, T value, Duration expire)
远程缓存数据- 指定者:
remoteSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型value
- 数据值expire
- 过期时长,Duration.ZERO为永不过期
-
remoteSetAsync
public <T> CompletableFuture<Void> remoteSetAsync(String name, String key, Type type, T value, Duration expire)
远程异步缓存数据- 指定者:
remoteSetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型value
- 数据值expire
- 过期时长,Duration.ZERO为永不过期- 返回:
- void
-
remoteDel
public long remoteDel(String name, String key)
远程删除缓存数据- 指定者:
remoteDel
在接口中CachedManager
- 参数:
name
- 缓存名称key
- 缓存键- 返回:
- 删除数量
-
remoteDelAsync
public CompletableFuture<Long> remoteDelAsync(String name, String key)
远程异步删除缓存数据- 指定者:
remoteDelAsync
在接口中CachedManager
- 参数:
name
- 缓存名称key
- 缓存键- 返回:
- 删除数量
-
bothGet
public <T> T bothGet(String name, String key, Type type)
远程获取缓存数据, 过期返回null- 指定者:
bothGet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型- 返回:
- 数据值
-
bothGetAsync
public <T> CompletableFuture<T> bothGetAsync(String name, String key, Type type)
远程异步获取缓存数据, 过期返回null- 指定者:
bothGetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型- 返回:
- 数据值
-
bothGetSet
public <T> T bothGetSet(String name, String key, Type type, boolean nullable, int localLimit, Duration localExpire, Duration remoteExpire, ThrowSupplier<T> supplier)
远程获取缓存数据, 过期返回null- 指定者:
bothGetSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限localExpire
- 本地过期时长,Duration.ZERO为永不过期,为null表示不本地缓存remoteExpire
- 远程过期时长,Duration.ZERO为永不过期,为null表示不远程缓存supplier
- 数据函数- 返回:
- 数据值
-
bothGetSetAsync
public <T> CompletableFuture<T> bothGetSetAsync(String name, String key, Type type, boolean nullable, int localLimit, Duration localExpire, Duration remoteExpire, ThrowSupplier<CompletableFuture<T>> supplier)
远程异步获取缓存数据, 过期返回null- 指定者:
bothGetSetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限localExpire
- 本地过期时长,Duration.ZERO为永不过期,为null表示不本地缓存remoteExpire
- 远程过期时长,Duration.ZERO为永不过期,为null表示不远程缓存supplier
- 数据函数- 返回:
- 数据值
-
bothSet
public <T> void bothSet(String name, String key, Type type, T value, Duration localExpire, Duration remoteExpire)
远程缓存数据- 指定者:
bothSet
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型value
- 数据值localExpire
- 本地过期时长,Duration.ZERO为永不过期,为null表示不本地缓存remoteExpire
- 远程过期时长,Duration.ZERO为永不过期,为null表示不远程缓存
-
bothSetAsync
public <T> CompletableFuture<Void> bothSetAsync(String name, String key, Type type, T value, Duration localExpire, Duration remoteExpire)
远程异步缓存数据- 指定者:
bothSetAsync
在接口中CachedManager
- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键type
- 数据类型value
- 数据值localExpire
- 本地过期时长,Duration.ZERO为永不过期,为null表示不本地缓存remoteExpire
- 远程过期时长,Duration.ZERO为永不过期,为null表示不远程缓存- 返回:
- void
-
bothDel
public long bothDel(String name, String key)
远程删除缓存数据- 指定者:
bothDel
在接口中CachedManager
- 参数:
name
- 缓存名称key
- 缓存键- 返回:
- 删除数量
-
bothDelAsync
public CompletableFuture<Long> bothDelAsync(String name, String key)
远程异步删除缓存数据- 指定者:
bothDelAsync
在接口中CachedManager
- 参数:
name
- 缓存名称key
- 缓存键- 返回:
- 删除数量
-
getSet
protected <T> T getSet(CachedManagerService.GetterFunc<CachedValue<T>> getter, CachedManagerService.SetterSyncFunc setter, String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<T> supplier)
获取缓存数据, 过期返回null- 类型参数:
T
- 泛型- 参数:
getter
- 获取数据函数setter
- 设置数据函数name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
getSetAsync
protected <T> CompletableFuture<T> getSetAsync(CachedManagerService.GetterFunc<CompletableFuture<CachedValue<T>>> getter, CachedManagerService.SetterAsyncFunc setter, String name, String key, Type type, boolean nullable, int localLimit, Duration expire, ThrowSupplier<CompletableFuture<T>> supplier)
异步获取缓存数据, 过期返回null- 类型参数:
T
- 泛型- 参数:
getter
- 获取数据函数setter
- 设置数据函数name
- 缓存名称key
- 缓存键type
- 数据类型nullable
- 是否缓存null值localLimit
- 本地缓存数量上限expire
- 过期时长,Duration.ZERO为永不过期supplier
- 数据函数- 返回:
- 数据值
-
localSetCache
protected <T> void localSetCache(String name, String key, int localLimit, Type type, T value, Duration expire)
-
localSetCache
protected <T> void localSetCache(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
remoteSetCache
protected <T> void remoteSetCache(String name, String key, Type type, T value, Duration expire)
-
remoteSetCache
protected <T> void remoteSetCache(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
remoteSetCache
protected <T> void remoteSetCache(String name, String key, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
localSetCacheAsync
protected <T> CompletableFuture<Void> localSetCacheAsync(String name, String key, int localLimit, Type type, T value, Duration expire)
-
localSetCacheAsync
protected <T> CompletableFuture<Void> localSetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
remoteSetCacheAsync
protected <T> CompletableFuture<Void> remoteSetCacheAsync(String name, String key, int localLimit, Type type, T value, Duration expire)
-
remoteSetCacheAsync
protected <T> CompletableFuture<Void> remoteSetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
remoteSetCacheAsync
protected <T> CompletableFuture<Void> remoteSetCacheAsync(String name, String key, Duration expire, Type cacheType, CachedValue<T> cacheVal)
-
bothGetCache
protected <T> CachedValue<T> bothGetCache(String name, String key, int localLimit, Duration expire, Type cacheType)
-
bothGetCacheAsync
protected <T> CompletableFuture<CachedValue<T>> bothGetCacheAsync(String name, String key, int localLimit, Duration expire, Type cacheType)
远程异步获取缓存数据, 过期返回null- 类型参数:
T
- 泛型- 参数:
name
- 缓存名称key
- 缓存键localLimit
- 本地缓存数量上限expire
- 过期时长,Duration.ZERO为永不过期cacheType
- 数据类型- 返回:
- 数据值
-
checkEnable
protected void checkEnable()
-
toCacheValue
protected <T> CachedValue<T> toCacheValue(boolean nullable, T value)
将原始数据函数转换成获取CacheValue数据函数- 类型参数:
T
- 泛型- 参数:
nullable
- 是否缓存null值value
- 缓存值- 返回:
- CacheValue函数
-
toCacheSupplier
protected <T> ThrowSupplier<CachedValue<T>> toCacheSupplier(boolean nullable, ThrowSupplier<T> supplier)
将原始数据函数转换成获取CacheValue数据函数- 类型参数:
T
- 泛型- 参数:
nullable
- 是否缓存null值supplier
- 数据函数- 返回:
- CacheValue函数
-
loadCacheType
protected Type loadCacheType(Type type, Object value)
创建数据类型创建对应CacheValue泛型- 参数:
type
- 数据类型,为null则取value的类型value
- 数据值- 返回:
- CacheValue泛型
-
-