public interface CacheManager
| 限定符和类型 | 字段和说明 |
|---|---|
static long |
VERSION_INCREMENT_STEP
版本自增步长
|
| 限定符和类型 | 方法和说明 |
|---|---|
Long |
addSet(String key,
Set<String> set)
增加集合对象
|
Long |
addSet(String key,
String... values)
增加集合对象
|
void |
cache(String key,
long ttl)
缓存信息
|
void |
cache(String key,
String value)
缓存信息
|
void |
cache(String key,
String value,
long ttl)
缓存信息
|
Long |
count(String key)
集合元素个数
|
void |
delete(String key)
清除
|
Boolean |
expire(String key,
long ttl)
设置过期时间(默认单位:秒)
|
Boolean |
expire(String key,
long ttl,
TimeUnit timeUnit)
设置过期时间
|
String |
get(String key)
获取值
|
Long |
increment(String key)
自增
|
boolean |
isExist(String key)
是否存在
|
Boolean |
isMember(String key,
String value)
集合内容是否包含元素对象
|
Set<String> |
members(String key)
获取集合内容
|
Boolean |
move(String key,
String value,
String destKey)
转移元素对象
|
Long |
remove(String key,
String... values)
删除集合中的元素对象
|
static final long VERSION_INCREMENT_STEP
void cache(String key, long ttl)
key - 缓存Keyttl - 过期时间(单位:秒)void cache(String key, String value, long ttl)
key - 缓存Keyvalue - 值ttl - 过期时间(单位:秒)boolean isExist(String key)
key - 缓存Keyvoid delete(String key)
key - 缓存KeyBoolean expire(String key, long ttl, TimeUnit timeUnit)
key - 缓存Keyttl - 过期时间timeUnit - 时间单位Boolean move(String key, String value, String destKey)
key - 缓存Keyvalue - 元素对象destKey - 目标缓存对象Copyright © 2021. All rights reserved.