public static class RedisConnectionConfig.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
RedisConnectionConfig |
build() |
static RedisConnectionConfig.Builder |
redis(String host)
Set Redis host.
|
static RedisConnectionConfig.Builder |
redis(String host,
int port)
Set Redis host and port.
|
static RedisConnectionConfig.Builder |
redisCluster(String host)
Set Cluster host.
|
static RedisConnectionConfig.Builder |
redisCluster(String host,
int port)
Set Cluster host and port.
|
static RedisConnectionConfig.Builder |
redisSentinel(String host)
Set Sentinel host.
|
static RedisConnectionConfig.Builder |
redisSentinel(String host,
int port)
Set Sentinel host and port.
|
static RedisConnectionConfig.Builder |
redisSentinel(String host,
int port,
String masterId)
Set Sentinel host, port and master id.
|
static RedisConnectionConfig.Builder |
redisSentinel(String host,
String masterId)
Set Sentinel host and master id.
|
RedisConnectionConfig.Builder |
withClientName(String clientName)
Configures a client name.
|
RedisConnectionConfig.Builder |
withDatabase(int database)
Configures the database number.
|
RedisConnectionConfig.Builder |
withHost(String host)
Adds host information to the builder.
|
RedisConnectionConfig.Builder |
withPassword(char[] password)
Configures authentication.
|
RedisConnectionConfig.Builder |
withPassword(String password)
Configures authentication.
|
RedisConnectionConfig.Builder |
withPort(int port)
Adds port information to the builder.
|
RedisConnectionConfig.Builder |
withRedisCluster(String host)
Add a withRedisCluster host to the existing builder.
|
RedisConnectionConfig.Builder |
withRedisCluster(String host,
int port)
Add a withRedisCluster host/port to the existing builder.
|
RedisConnectionConfig.Builder |
withRedisSentinel(String host)
Add a withRedisSentinel host to the existing builder.
|
RedisConnectionConfig.Builder |
withRedisSentinel(String host,
int port)
Add a withRedisSentinel host/port to the existing builder.
|
RedisConnectionConfig.Builder |
withSentinelMasterId(String sentinelMasterId)
Configures a redisSentinel master Id.
|
RedisConnectionConfig.Builder |
withTimeout(long timeout)
Configures a timeout.
|
public static RedisConnectionConfig.Builder redis(String host)
host - the host namepublic static RedisConnectionConfig.Builder redis(String host, int port)
host - the host nameport - the portpublic static RedisConnectionConfig.Builder redisSentinel(String host)
host - the host namepublic static RedisConnectionConfig.Builder redisSentinel(String host, int port)
host - the host nameport - the portpublic static RedisConnectionConfig.Builder redisSentinel(String host, String masterId)
host - the host namemasterId - redisSentinel master idpublic static RedisConnectionConfig.Builder redisSentinel(String host, int port, String masterId)
host - the host nameport - the portmasterId - redisSentinel master idpublic RedisConnectionConfig.Builder withRedisSentinel(String host)
host - the host namepublic RedisConnectionConfig.Builder withRedisSentinel(String host, int port)
host - the host nameport - the portpublic static RedisConnectionConfig.Builder redisCluster(String host)
host - the host namepublic static RedisConnectionConfig.Builder redisCluster(String host, int port)
host - the host nameport - the portpublic RedisConnectionConfig.Builder withRedisCluster(String host)
host - the host namepublic RedisConnectionConfig.Builder withRedisCluster(String host, int port)
host - the host nameport - the portpublic RedisConnectionConfig.Builder withHost(String host)
host - the portpublic RedisConnectionConfig.Builder withPort(int port)
port - the portpublic RedisConnectionConfig.Builder withDatabase(int database)
database - the database numberpublic RedisConnectionConfig.Builder withClientName(String clientName)
clientName - the client namepublic RedisConnectionConfig.Builder withPassword(String password)
password - the passwordpublic RedisConnectionConfig.Builder withPassword(char[] password)
password - the passwordpublic RedisConnectionConfig.Builder withTimeout(long timeout)
timeout - must not be null or negative.public RedisConnectionConfig.Builder withSentinelMasterId(String sentinelMasterId)
sentinelMasterId - redisSentinel master id, must not be empty or nullpublic RedisConnectionConfig build()
Copyright © 2022 Alibaba Group. All rights reserved.