public class ConnectionEndpointList extends AbstractList<ConnectionEndpoint>
Iterable,
InetSocketAddress,
ConnectionEndpointmodCount| 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.
|
boolean |
add(ConnectionEndpoint connectionEndpoint) |
ConnectionEndpointList |
add(Iterable<ConnectionEndpoint> connectionEndpoints)
Adds the Iterable collection of ConnectionEndpoints to this list.
|
void |
clear()
Clears the current list of
ConnectionEndpoints. |
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.
|
ConnectionEndpoint |
findOne(int port)
Finds the first
ConnectionEndpoint in the collection with the given port. |
ConnectionEndpoint |
findOne(String host)
Finds the first
ConnectionEndpoint in the collection with the given host. |
static ConnectionEndpointList |
from(ConnectionEndpoint... connectionEndpoints)
Factory method for creating a
ConnectionEndpointList from an array of ConnectionEndpoints. |
static ConnectionEndpointList |
from(InetSocketAddress... socketAddresses)
Converts an array of
InetSocketAddress into an instance of ConnectionEndpointList. |
static ConnectionEndpointList |
from(Iterable<InetSocketAddress> socketAddresses)
|
ConnectionEndpoint |
get(int index)
Gets the
ConnectionEndpoint at the given index in this list. |
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.
|
ConnectionEndpoint |
set(int index,
ConnectionEndpoint element)
Sets the element at the given index in this list to the given
ConnectionEndpoint. |
int |
size()
Determines the number of ConnectionEndpoints contained in this collection.
|
ConnectionEndpoint[] |
toArray()
Converts this collection of
ConnectionEndpoints into an array of ConnectionEndpoints. |
List<InetSocketAddress> |
toInetSocketAddresses()
|
String |
toString() |
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, subListaddAll, contains, containsAll, remove, removeAll, retainAll, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArrayparallelStream, removeIf, streampublic 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(ConnectionEndpoint... connectionEndpoints)
ConnectionEndpointList from an array of ConnectionEndpoints.connectionEndpoints - the array of ConnectionEndpoints used to initialize
the ConnectionEndpointList.ConnectionEndpointList initialized with the array of ConnectionEndpoints.ConnectionEndpointpublic static ConnectionEndpointList from(InetSocketAddress... socketAddresses)
InetSocketAddress into an instance of ConnectionEndpointList.socketAddresses - the array of InetSocketAddress used to initialize
an instance of ConnectionEndpointList.ConnectionEndpointList initialized with the array of InetSocketAddress.InetSocketAddress,
from(Iterable)public static ConnectionEndpointList from(Iterable<InetSocketAddress> socketAddresses)
socketAddresses - in Iterable collection of InetSocketAddress used to initialize
an instance of ConnectionEndpointList.ConnectionEndpointList initialized with the array of InetSocketAddress.Iterable,
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 boolean add(ConnectionEndpoint connectionEndpoint)
add in interface Collection<ConnectionEndpoint>add in interface List<ConnectionEndpoint>add in class AbstractList<ConnectionEndpoint>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 void clear()
ConnectionEndpoints.clear in interface Collection<ConnectionEndpoint>clear in interface List<ConnectionEndpoint>clear in class AbstractList<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 ConnectionEndpoint findOne(String host)
ConnectionEndpoint in the collection with the given host.host - a String indicating the hostname of the ConnectionEndpoint to find.ConnectionEndpoint in this collection with the given host,
or null if no ConnectionEndpoint exists with the given hostname.findBy(String)public ConnectionEndpoint findOne(int port)
ConnectionEndpoint in the collection with the given port.port - an integer indicating the port number of the ConnectionEndpoint to find.ConnectionEndpoint in this collection with the given port,
or null if no ConnectionEndpoint exists with the given port number.findBy(int)public ConnectionEndpoint get(int index)
ConnectionEndpoint at the given index in this list.get in interface List<ConnectionEndpoint>get in class AbstractList<ConnectionEndpoint>index - an integer value indicating the index of the ConnectionEndpoint of interest.ConnectionEndpoint at index in this list.IndexOutOfBoundsException - if the index is not within the bounds of this list.ConnectionEndpoint,
AbstractList.get(int)public ConnectionEndpoint set(int index, ConnectionEndpoint element)
ConnectionEndpoint.set in interface List<ConnectionEndpoint>set in class AbstractList<ConnectionEndpoint>index - the index in the list at which to set the ConnectionEndpoint.element - the ConnectionEndpoint to set in this list at the given index.ConnectionEndpoint at index in this list or null if no ConnectionEndpoint
at index existed.IndexOutOfBoundsException - if the index is not within the bounds of this list.ConnectionEndpoint,
AbstractList.set(int, Object)public boolean isEmpty()
isEmpty in interface Collection<ConnectionEndpoint>isEmpty in interface List<ConnectionEndpoint>isEmpty in class AbstractCollection<ConnectionEndpoint>public Iterator<ConnectionEndpoint> iterator()
iterator in interface Iterable<ConnectionEndpoint>iterator in interface Collection<ConnectionEndpoint>iterator in interface List<ConnectionEndpoint>iterator in class AbstractList<ConnectionEndpoint>public int size()
size in interface Collection<ConnectionEndpoint>size in interface List<ConnectionEndpoint>size in class AbstractCollection<ConnectionEndpoint>public ConnectionEndpoint[] toArray()
ConnectionEndpoints into an array of ConnectionEndpoints.toArray in interface Collection<ConnectionEndpoint>toArray in interface List<ConnectionEndpoint>toArray in class AbstractCollection<ConnectionEndpoint>ConnectionEndpoints representing this collection.public List<InetSocketAddress> toInetSocketAddresses()
List of InetSocketAddresses representing this collection of ConnectionEndpoints.ConnectionEndpoint.toInetSocketAddress(),
InetSocketAddress,
Listpublic String toString()
toString in class AbstractCollection<ConnectionEndpoint>