public class RedisNode extends Object implements Serializable, RedisNamedNode
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_DATABASE |
static String |
DEFAULT_HOST |
static int |
DEFAULT_PORT |
static int |
DEFAULT_SENTINEL_PORT |
构造器和说明 |
---|
RedisNode(String host)
构造函数
|
RedisNode(String host,
int port)
构造函数
|
RedisNode(String host,
int port,
Role role)
构造函数
|
RedisNode(String host,
Role role)
构造函数
|
限定符和类型 | 方法和说明 |
---|---|
String |
asString() |
boolean |
equals(Object obj) |
String |
getHost()
返回主机地址
|
String |
getId()
返回主机 ID
|
String |
getMasterId()
返回主机 Master Id
|
String |
getName()
返回主机名称
|
int |
getPort()
返回主机端口
|
Role |
getRole()
返回主机角色
|
int |
hashCode() |
boolean |
isMaster()
返回是否为 Master 节点
|
boolean |
isReplica()
返回是否为 Slave 节点
|
boolean |
isSlave()
返回是否为 Slave 节点
|
void |
setHost(String host)
设置主机地址
|
void |
setId(String id)
设置主机 ID
|
void |
setMasterId(String masterId)
设置主机 Master Id
|
void |
setName(String name)
设置主机名称
|
void |
setPort(int port)
设置主机端口
|
void |
setRole(Role role)
设置主机角色
|
String |
toString() |
public static final int DEFAULT_PORT
public static final int DEFAULT_SENTINEL_PORT
public static final int DEFAULT_DATABASE
public RedisNode(@Nullable String host)
host
- 主机地址public RedisNode(@Nullable String host, int port)
host
- 主机地址port
- 端口public RedisNode(@Nullable String host, @Nullable Role role)
host
- 主机地址role
- 主机角色@Nullable public String getId()
public void setId(@Nullable String id)
id
- 主机 IDpublic void setName(@Nullable String name)
name
- 主机名称@Nullable public String getHost()
public void setHost(@Nullable String host)
host
- 主机地址public int getPort()
public void setPort(int port)
port
- 主机端口@Nullable public Role getRole()
public void setRole(@Nullable Role role)
role
- 主机角色@Nullable public String getMasterId()
public void setMasterId(@Nullable String masterId)
masterId
- 主机 Master Idpublic boolean isMaster()
public boolean isSlave()
public boolean isReplica()
public String asString()
Copyright © 2022 buession.com Inc.. All rights reserved.