com.rabbitmq.client
Class Address

java.lang.Object
  extended by com.rabbitmq.client.Address

public class Address
extends java.lang.Object

A representation of network addresses, i.e. host/port pairs, with some utility functions for parsing address strings.


Constructor Summary
Address(java.lang.String host)
          Construct an address from a host.
Address(java.lang.String host, int port)
          Construct an address from a host name and port number.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getHost()
          Get the host name
 int getPort()
          Get the port number
 int hashCode()
           
static Address parseAddress(java.lang.String addressString)
          Factory method: takes a formatted addressString string as construction parameter
static Address[] parseAddresses(java.lang.String addresses)
          Array-based factory method: takes an array of formatted address strings as construction parameter
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address(java.lang.String host,
               int port)
Construct an address from a host name and port number.

Parameters:
host - the host name
port - the port number

Address

public Address(java.lang.String host)
Construct an address from a host.

Parameters:
host - the host name
Method Detail

getHost

public java.lang.String getHost()
Get the host name

Returns:
the host name

getPort

public int getPort()
Get the port number

Returns:
the port number

parseAddress

public static Address parseAddress(java.lang.String addressString)
Factory method: takes a formatted addressString string as construction parameter

Parameters:
addressString - an addressString of the form "host[:port]".
Returns:
an Address from the given data

parseAddresses

public static Address[] parseAddresses(java.lang.String addresses)
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 Address values

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object