public class

Address

extends Object
java.lang.Object
   ↳ com.rabbitmq.client.Address

Class Overview

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

Summary

Public Constructors
Address(String host, int port)
Construct an address from a host name and port number.
Address(String host)
Construct an address from a host.
Public Methods
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()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Address (String host, int port)

Construct an address from a host name and port number.

Parameters
host the host name
port the port number

public Address (String host)

Construct an address from a host.

Parameters
host the host name

Public Methods

public boolean equals (Object obj)

public String getHost ()

Get the host name

Returns
  • the host name

public int getPort ()

Get the port number

Returns
  • the port number

public int hashCode ()

public static Address parseAddress (String addressString)

Factory method: takes a formatted addressString string as construction parameter

Parameters
addressString an addressString of the form "host[:port]".
Returns

public static Address[] parseAddresses (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

public String toString ()