Class HostAndPort


  • public final class HostAndPort
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      static HostAndPort fromString​(java.lang.String hostPort, int defaultPort)
      Constructs a host-port pair from the given string, defaulting to the indicated port if absent
      java.lang.String getHost()
      Returns the unvalidated hostname or IP literal
      int getPort()
      Returns the port
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • getHost

        public java.lang.String getHost()
        Returns the unvalidated hostname or IP literal
      • getPort

        public int getPort()
        Returns the port
      • equals

        public boolean equals​(java.lang.Object o)
        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
      • fromString

        public static HostAndPort fromString​(java.lang.String hostPort,
                                             int defaultPort)
        Constructs a host-port pair from the given string, defaulting to the indicated port if absent