Class HostAndPort


  • public class HostAndPort
    extends java.lang.Object
    HostAndPort 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
      boolean equals​(java.lang.Object obj)  
      static HostAndPort from​(java.lang.String hostAndPortStr)
      Parse host:port string into HostAndPort object.
      java.lang.String getHost()
      Get the host.
      int getPort()
      Get the port.
      int hashCode()  
      static HostAndPort parseString​(java.lang.String hostPort)
      Parse a host:port string into a HostAndPort instance.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HostAndPort

        public HostAndPort​(java.lang.String host,
                           int port)
        Create a new HostAndPort instance.
        Parameters:
        host - the hostname or IP address
        port - the port number
    • 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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