Class Address

java.lang.Object
io.atomix.utils.net.Address

public final class Address extends Object
Representation of a network address.
  • Constructor Details

    • Address

      public Address(String host, int port)
    • Address

      public Address(String host, int port, InetAddress address)
  • Method Details

    • local

      public static Address local()
      Returns an address that binds to all interfaces.
      Returns:
      the address
    • from

      public static Address from(String address)
      Returns the address from the given host:port string.
      Parameters:
      address - the address string
      Returns:
      the address
    • from

      public static Address from(String host, int port)
      Returns an address for the given host/port.
      Parameters:
      host - the host name
      port - the port
      Returns:
      a new address
    • from

      public static Address from(int port)
      Returns an address for the local host and the given port.
      Parameters:
      port - the port
      Returns:
      a new address
    • host

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

      public int port()
      Returns the port.
      Returns:
      the port
    • address

      public InetAddress address()
      Returns the IP address.
      Returns:
      the IP address
    • address

      public InetAddress address(boolean resolve)
      Returns the IP address.
      Parameters:
      resolve - whether to force resolve the hostname
      Returns:
      the IP address
    • socketAddress

      public InetSocketAddress socketAddress()
    • type

      public Address.Type type()
      Returns the address type.
      Returns:
      the address type
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object