org.ros.address
Class AdvertiseAddress
java.lang.Object
org.ros.address.AdvertiseAddress
public class AdvertiseAddress
- extends java.lang.Object
A wrapper for InetSocketAddress
that emphasizes the difference
between an address that should be used for binding a server port and one that
should be advertised to external entities.
An AdvertiseAddress
encourages lazy lookups of port information to
prevent accidentally storing a bind port (e.g. 0 for OS picked) instead of
the advertised port.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
AdvertiseAddress
public AdvertiseAddress(java.lang.String host)
newPrivate
public static AdvertiseAddress newPrivate()
newPublic
public static AdvertiseAddress newPublic()
- Best effort method, returns a new
AdvertiseAddress
where the host
is determined automatically.
- Returns:
- a suitable
AdvertiseAddress
for a publicly accessible
BindAddress
getHost
public java.lang.String getHost()
setStaticPort
public void setStaticPort(int port)
getPort
public int getPort()
setPortCallable
public void setPortCallable(java.util.concurrent.Callable<java.lang.Integer> portCallable)
toInetAddress
public java.net.InetAddress toInetAddress()
toInetSocketAddress
public java.net.InetSocketAddress toInetSocketAddress()
toUri
public java.net.URI toUri(java.lang.String scheme)
isLoopbackAddress
public boolean isLoopbackAddress()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object