public class HostAndPort extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getHostText() |
int |
getPort() |
int |
hashCode() |
boolean |
hasPort() |
static HostAndPort |
of(String host,
int port)
|
static HostAndPort |
parse(String hostPortString)
Parse a host and port string into a
HostAndPort. |
static HostAndPort |
parseCompat(String hostAndPortPart)
Temporary workaround until Redis provides IPv6 addresses in bracket notation.
|
String |
toString() |
public final String hostText
public final int port
public static HostAndPort of(String host, int port)
host - the hostname.port - a valid port.HostAndPort of host and port.public static HostAndPort parse(String hostPortString)
hostPortString - public static HostAndPort parseCompat(String hostAndPortPart)
1.2.3.4:6479 and
dead:beef:dead:beef:affe::1:6379 into host and port. We assume the last item after the colon is a port.hostAndPortPart - the string containing the host and port.HostAndPort.public boolean hasPort()
true if has a port.public String getHostText()
public int getPort()
Copyright © 2021 lettuce.io. All rights reserved.