public class ClusterAddressParser extends Object implements Parser<String,List<NetworkAddress>>
case 1: host1:port1,host2:port2,host3,host4:port4 => host1:port1, host2:port2,host3:defaultPort,host4:port4 case 2: host1,host2,host3:port => host1:port,host2:port,host3:port case 3: host1,host2,host3 => host1:defaultPort, host2:defaultPort, host3: defaultPort
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ClusterAddressParser.ClusterAddressStyle |
| 构造器和说明 |
|---|
ClusterAddressParser() |
ClusterAddressParser(int defaultPort) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getDefaultPort() |
static String |
normalize(List<NetworkAddress> addresses,
ClusterAddressParser.ClusterAddressStyle style)
转换为 host1:port1,host2:port2,host3:port3结构
|
String |
normalize(String s) |
String |
normalize(String s,
ClusterAddressParser.ClusterAddressStyle style) |
List<NetworkAddress> |
parse(String s) |
void |
setDefaultPort(int defaultPort) |
public ClusterAddressParser()
public ClusterAddressParser(int defaultPort)
public static String normalize(List<NetworkAddress> addresses, ClusterAddressParser.ClusterAddressStyle style)
public List<NetworkAddress> parse(String s)
parse 在接口中 Parser<String,List<NetworkAddress>>public String normalize(String s, ClusterAddressParser.ClusterAddressStyle style)
public int getDefaultPort()
public void setDefaultPort(int defaultPort)
Copyright © 2022. All rights reserved.