Package io.atomix.utils.net
Class Address
java.lang.Object
io.atomix.utils.net.Address
Representation of a network address.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic Addressfrom(int port) Returns an address for the local host and the given port.static AddressReturns the address from the given host:port string.static AddressReturns an address for the given host/port.Returns the IP address or null if it is unresolved.inthashCode()host()Returns the host name.static Addresslocal()Returns an address that binds to all interfaces.intport()Returns the port.Returns the socket address.toString()Tries to resolve and returns the IP address.
-
Constructor Details
-
Address
-
Address
-
-
Method Details
-
local
Returns an address that binds to all interfaces.- Returns:
- the address
-
from
Returns the address from the given host:port string.- Parameters:
address- the address string- Returns:
- the address
-
from
Returns an address for the given host/port.- Parameters:
host- the host nameport- the port- Returns:
- a new address
-
from
Returns an address for the local host and the given port.- Parameters:
port- the port- Returns:
- a new address
-
host
Returns the host name.- Returns:
- the host name
-
port
public int port()Returns the port.- Returns:
- the port
-
tryResolveAddress
Tries to resolve and returns the IP address.- Returns:
- the IP address
-
getAddress
Returns the IP address or null if it is unresolved.- Returns:
- the IP address
-
socketAddress
Returns the socket address.- Returns:
- the socket address
-
hashCode
public int hashCode() -
equals
-
toString
-