Package redis.clients.jedis
Class HostAndPort
- java.lang.Object
-
- redis.clients.jedis.HostAndPort
-
public class HostAndPort extends java.lang.ObjectHostAndPort compatibility class for Valkey GLIDE wrapper. Represents a host and port combination for cluster node addressing.
-
-
Constructor Summary
Constructors Constructor Description HostAndPort(java.lang.String host, int port)Create a new HostAndPort instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static HostAndPortfrom(java.lang.String hostAndPortStr)Parse host:port string into HostAndPort object.java.lang.StringgetHost()Get the host.intgetPort()Get the port.inthashCode()static HostAndPortparseString(java.lang.String hostPort)Parse a host:port string into a HostAndPort instance.java.lang.StringtoString()
-
-
-
Method Detail
-
getHost
public java.lang.String getHost()
Get the host.- Returns:
- the hostname or IP address
-
getPort
public int getPort()
Get the port.- Returns:
- the port number
-
from
public static HostAndPort from(java.lang.String hostAndPortStr)
Parse host:port string into HostAndPort object.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parseString
public static HostAndPort parseString(java.lang.String hostPort)
Parse a host:port string into a HostAndPort instance.- Parameters:
hostPort- the host:port string- Returns:
- HostAndPort instance
- Throws:
java.lang.IllegalArgumentException- if the format is invalid
-
-