public class ConnectionEndpointList extends Object implements Iterable<ConnectionEndpoint>
Iterable,
InetSocketAddress,
ConnectionEndpoint| Constructor and Description |
|---|
ConnectionEndpointList()
Constructs an empty, uninitialized instance of the ConnectionEndpointList collection.
|
ConnectionEndpointList(ConnectionEndpoint... connectionEndpoints)
Constructs an instance of ConnectionEndpointList initialized with the the array of ConnectionEndpoints.
|
ConnectionEndpointList(Iterable<ConnectionEndpoint> connectionEndpoints)
Constructs an instance of ConnectionEndpointList initialized with the Iterable collection of ConnectionEndpoints.
|
| Modifier and Type | Method and Description |
|---|---|
ConnectionEndpointList |
add(ConnectionEndpoint... connectionEndpoints)
Adds the array of ConnectionEndpoints to this list.
|
ConnectionEndpointList |
add(Iterable<ConnectionEndpoint> connectionEndpoints)
Adds the Iterable collection of ConnectionEndpoints to this list.
|
ConnectionEndpointList |
findBy(int port)
Finds all ConnectionEndpoints in this list with the specified port number.
|
ConnectionEndpointList |
findBy(String host)
Finds all ConnectionEndpoints in this list with the specified hostname.
|
static ConnectionEndpointList |
from(InetSocketAddress... socketAddresses)
Converts the array of InetSocketAddresses into an instance of ConnectionEndpointList.
|
static ConnectionEndpointList |
from(Iterable<InetSocketAddress> socketAddresses)
Converts the Iterable collection of InetSocketAddresses into an instance of ConnectionEndpointList.
|
boolean |
isEmpty()
Determines whether this collection contains any ConnectionEndpoints.
|
Iterator<ConnectionEndpoint> |
iterator() |
static ConnectionEndpointList |
parse(int defaultPort,
String... hostsPorts)
Parses the array of hosts and ports in the format 'host[port]' to convert into an instance
of ConnectionEndpointList.
|
int |
size()
Determines the number of ConnectionEndpoints contained in this collection.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ConnectionEndpointList()
public ConnectionEndpointList(ConnectionEndpoint... connectionEndpoints)
connectionEndpoints - is an array containing ConnectionEndpoints to add to this collection.ConnectionEndpoint,
ConnectionEndpointList(Iterable)public ConnectionEndpointList(Iterable<ConnectionEndpoint> connectionEndpoints)
connectionEndpoints - the Iterable object containing ConnectionEndpoints to add to this collection.ConnectionEndpoint,
Iterablepublic static ConnectionEndpointList from(InetSocketAddress... socketAddresses)
socketAddresses - the array of InetSocketAddresses used to initialize an instance of ConnectionEndpointList.InetSocketAddress,
from(Iterable)public static ConnectionEndpointList from(Iterable<InetSocketAddress> socketAddresses)
socketAddresses - in Iterable collection of InetSocketAddresses used to initialize an instance
of ConnectionEndpointList.InetSocketAddresspublic static ConnectionEndpointList parse(int defaultPort, String... hostsPorts)
defaultPort - the default port number to use if port is not specified in a host and port value.hostsPorts - the array of hosts and ports to parse.ConnectionEndpoint.parse(String, int)public final ConnectionEndpointList add(ConnectionEndpoint... connectionEndpoints)
connectionEndpoints - the array of ConnectionEndpoints to add to this list.ConnectionEndpoint,
add(Iterable)public final ConnectionEndpointList add(Iterable<ConnectionEndpoint> connectionEndpoints)
connectionEndpoints - the Iterable collection of ConnectionEndpoints to add to this list.ConnectionEndpoint,
add(ConnectionEndpoint...)public ConnectionEndpointList findBy(String host)
host - a String indicating the hostname to use in the match.findBy(int)public ConnectionEndpointList findBy(int port)
port - an Integer value indicating the port number to use in the match.findBy(String)public boolean isEmpty()
public Iterator<ConnectionEndpoint> iterator()
iterator in interface Iterable<ConnectionEndpoint>public int size()