Package org.dellroad.msrp
Class Endpoint
- java.lang.Object
 - 
- org.dellroad.msrp.Endpoint
 
 
- 
public class Endpoint extends Object
Combination of a host and port.Instances are immutable.
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetHost()intgetPort()inthashCode()InetSocketAddresstoSocketAddress()Convert this instance to aInetSocketAddress.StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
Endpoint
public Endpoint(String host, int port)
Constructor.- Parameters:
 host- remote hostport- TCP port- Throws:
 IllegalArgumentException- ifhostis nullIllegalArgumentException- ifportis not in the range 1-65535
 
 - 
 
- 
Method Detail
- 
getHost
public String getHost()
 
- 
getPort
public int getPort()
 
- 
toSocketAddress
public InetSocketAddress toSocketAddress()
Convert this instance to aInetSocketAddress. This may result in a DNS lookup. If the lookup fails, the returnedInetSocketAddresswill be unresolved.- Returns:
 - new socket address based on this instance
 
 
 - 
 
 -