Represents a network location at which a particular service can be reached.
Inherited Constant Summary
Public Method Summary
static NetworkLocation |
create(String ipAddress,
int port)
Returns a new
NetworkLocation instance for the given ipAddress string
and {code port}.
|
static NetworkLocation |
create(InetAddress
ipAddress, int port)
|
boolean | |
String |
getFormattedIpAddress()
Returns the IP address as a formatted string, including the scope ID if the IP
address is an IPv6 address with the scope ID specified.
|
InetAddress |
getIpAddress()
Returns the IP address associated with this location.
|
int |
getPort()
Returns the port on the associated IP address associated with this location.
|
int |
hashCode()
|
String |
toString()
|
void |
writeToParcel(Parcel dest, int
flags)
|
Inherited Method Summary
Public Methods
public static NetworkLocation create (String ipAddress, int port)
Returns a new NetworkLocation
instance for the given ipAddress
string and {code port}. If the IP address
string includes a scope ID (e.g. fe80::0:2%43) this scope will be included in the
Inet6Address
.
Throws
IllegalArgumentException | if the ipAddress is malformed |
---|
public static NetworkLocation create (InetAddress ipAddress, int port)
Returns a new NetworkLocation
instance for the given ipAddress
and port
.
public boolean equals (Object other)
public String getFormattedIpAddress ()
Returns the IP address as a formatted string, including the scope ID if the IP address is an IPv6 address with the scope ID specified. (e.g. fe80::0:2%47)
public InetAddress getIpAddress ()
Returns the IP address associated with this location.
public int getPort ()
Returns the port on the associated IP address associated with this location.