public class RedisDS extends Object implements Closeable, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
REDIS_CONFIG_PATH
默认配置文件
|
Constructor and Description |
---|
RedisDS()
构造,使用默认配置文件,默认分组
|
RedisDS(Setting setting,
String group)
构造
|
RedisDS(String group)
构造,使用默认配置文件
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static RedisDS |
create()
创建RedisDS,使用默认配置文件,默认分组
|
static RedisDS |
create(Setting setting,
String group)
创建RedisDS
|
static RedisDS |
create(String group)
创建RedisDS,使用默认配置文件
|
Long |
del(String... keys)
从Redis中删除多个值
|
redis.clients.jedis.Jedis |
getJedis()
从资源池中获取
Jedis |
String |
getStr(String key)
从Redis中获取值
|
RedisDS |
init(String group)
初始化Jedis客户端
|
String |
setStr(String key,
String value)
从Redis中设置值
|
public static final String REDIS_CONFIG_PATH
public RedisDS()
public RedisDS(String group)
group
- 配置文件中配置分组public static RedisDS create()
public static RedisDS create(String group)
group
- 配置文件中配置分组public static RedisDS create(Setting setting, String group)
setting
- 配置文件group
- 配置文件中配置分组public redis.clients.jedis.Jedis getJedis()
Jedis
Jedis
public String setStr(String key, String value)
key
- 键value
- 值public Long del(String... keys)
keys
- 需要删除值对应的键列表public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2024. All rights reserved.