Package com.rabbitmq.client
Class Address
java.lang.Object
com.rabbitmq.client.Address
A representation of network addresses, i.e. host/port pairs,
with some utility functions for parsing address strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHost()Get the host nameintgetPort()Get the port numberinthashCode()static AddressparseAddress(String addressString) Factory method: takes a formatted addressString string as construction parameterstatic Address[]parseAddresses(String addresses) Array-based factory method: takes an array of formatted address strings as construction parametertoString()
-
Constructor Details
-
Address
Construct an address from a host name and port number.- Parameters:
host- the host nameport- the port number
-
Address
Construct an address from a host.- Parameters:
host- the host name
-
-
Method Details
-
getHost
Get the host name- Returns:
- the host name
-
getPort
public int getPort()Get the port number- Returns:
- the port number
-
parseAddress
Factory method: takes a formatted addressString string as construction parameter- Parameters:
addressString- an addressString of the form "host[:port]".- Returns:
- an
Addressfrom the given data
-
parseAddresses
Array-based factory method: takes an array of formatted address strings as construction parameter- Parameters:
addresses- array of strings of form "host[:port],..."- Returns:
- a list of
Addressvalues
-
hashCode
public int hashCode() -
equals
-
toString
-