🎉 BladeRedis增加getAndDel方法

This commit is contained in:
smallchill 2025-02-27 22:25:30 +08:00
parent b92f4574cc
commit 47eb3b411a

View File

@ -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
*