Class NetworkAddress

java.lang.Object
org.apache.ignite.network.NetworkAddress

public class NetworkAddress extends Object
Representation of a network address that includes a host name and a port.
  • Constructor Details

    • NetworkAddress

      public NetworkAddress(String host, int port)
      Constructor.
      Parameters:
      host - Host.
      port - Port.
  • Method Details

    • from

      public static NetworkAddress from(String addrStr)
      Parses a NetworkAddress from a string in the "host:port" format.
      Parameters:
      addrStr - String in "host:port" format.
      Returns:
      Parsed address.
      Throws:
      IllegalArgumentException - If the provided string does not match the required format.
    • from

      public static NetworkAddress from(InetSocketAddress addr)
      Creates a NetworkAddress from a InetSocketAddress.
      Parameters:
      addr - Address.
      Returns:
      Created network address.
    • host

      public String host()
      Returns the host name.
      Returns:
      Host name.
    • port

      public int port()
      Returns the network port.
      Returns:
      Port.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object