public class Address extends Object
Constructor and Description |
---|
Address(String host)
Construct an address from a host.
|
Address(String host,
int port)
Construct an address from a host name and port number.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getHost()
Get the host name
|
int |
getPort()
Get the port number
|
int |
hashCode() |
static Address |
parseAddress(String addressString)
Factory method: takes a formatted addressString string as construction parameter
|
static Address[] |
parseAddresses(String addresses)
Array-based factory method: takes an array of formatted address strings as construction parameter
|
String |
toString() |
public Address(String host, int port)
host
- the host nameport
- the port numberpublic Address(String host)
host
- the host namepublic String getHost()
public int getPort()
public static Address parseAddress(String addressString)
addressString
- an addressString of the form "host[:port]".Address
from the given datapublic static Address[] parseAddresses(String addresses)
addresses
- array of strings of form "host[:port],..."Address
valuesCopyright © 2018 Pivotal Software, Inc.. All rights reserved.