public class RedisBucket extends Object
| 构造器和说明 |
|---|
RedisBucket(RedisClient client) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
delay(String key,
int inSeconds)
延期
|
Boolean |
exists(String key)
检查是否存在
|
Long |
existsByKeys(Collection<String> keys)
检查是多个主键是否存在
|
Long |
existsByPattern(String pattern)
检查一批匹配模式的主键是否存在
|
String |
get(String key)
获取
|
<T> T |
getAndDeserialize(String key)
获取并反序列化
|
String |
getOrStore(String key,
int inSeconds,
Supplier<String> supplier) |
<T> T |
getOrStoreAndSerialize(String key,
int inSeconds,
Supplier<T> supplier) |
Set<String> |
keys(String pattern)
获取主键
|
Boolean |
remove(String key)
移除
|
Long |
removeByKeys(Collection<String> keys)
移除多个主键
|
Long |
removeByPattern(String pattern)
移除一批匹配模式的主键
|
void |
store(String key,
String val)
永久存储
|
void |
store(String key,
String val,
int inSeconds)
存储
|
void |
storeAndSerialize(String key,
Object obj)
永久存储并序列化
|
void |
storeAndSerialize(String key,
Object obj,
int inSeconds)
存储并序列化
|
long |
ttl(String key)
获取剩余时间
|
public RedisBucket(RedisClient client)
public <T> T getAndDeserialize(String key)
public <T> T getOrStoreAndSerialize(String key, int inSeconds, Supplier<T> supplier)
public Long existsByKeys(Collection<String> keys)
public Long removeByKeys(Collection<String> keys)
public void delay(String key, int inSeconds)
public long ttl(String key)
Copyright © 2022. All rights reserved.