Class ServiceAddress


  • public class ServiceAddress
    extends Object
    This class represents a TCP service address with hostname and port.
    • Constructor Detail

      • ServiceAddress

        public ServiceAddress​(String hostName,
                              int port)
        Create a new ServiceAddress.
        Parameters:
        hostName - host name
        port - port
    • Method Detail

      • local

        public static ServiceAddress local​(int port)
        Create a ServiceAddress for a local service.
        Parameters:
        port - port number
        Returns:
        service address
      • getHostName

        public String getHostName()
        Get the host name.
        Returns:
        host name
      • getPort

        public int getPort()
        Get the port.
        Returns:
        port
      • isLocal

        public boolean isLocal()
        Get if this is a local address. (host = localhost)
        Returns:
        true if it's a local address
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object