mirror of
https://github.com/chillzhuang/blade-tool
synced 2025-04-17 10:09:20 +08:00
🎉 BladeRedis增加getAndDel方法
This commit is contained in:
parent
b92f4574cc
commit
47eb3b411a
@ -225,6 +225,20 @@ public class BladeRedis {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 key 对应的值,并删除 key
|
||||
*
|
||||
* @param key 键
|
||||
* @param <T> 返回值类型
|
||||
* @return 值
|
||||
*/
|
||||
@Nullable
|
||||
public <T> T getAndDel(String key) {
|
||||
T o = this.get(key);
|
||||
this.del(key);
|
||||
return o;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定的 key
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user