public class ConnectionEndpointList extends AbstractList<ConnectionEndpoint>
Iterable,
InetSocketAddress,
AbstractList,
List,
ConnectionEndpointmodCount| Constructor and Description |
|---|
ConnectionEndpointList()
Constructs a new, empty and uninitialized instance of the
ConnectionEndpointList. |
ConnectionEndpointList(ConnectionEndpoint... connectionEndpoints)
Constructs a new instance of
ConnectionEndpointList initialized with an array
of ConnectionEndpoints. |
ConnectionEndpointList(Iterable<ConnectionEndpoint> connectionEndpoints)
Constructs a new 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)
Adds the given
ConnectionEndpoint to this list. |
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 used to create a
ConnectionEndpointList from an array of
ConnectionPoints. |
static ConnectionEndpointList |
from(InetSocketAddress... socketAddresses)
Factory method used to create a
ConnectionEndpointList from an array of
InetSocketAddresses. |
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] or host:port
to convert into an instance of ConnectionEndpointList. |
static ConnectionEndpointList |
parse(String commaDelimitedHostAndPorts,
int defaultPort)
Parses the comma-delimited
hosts and ports in the format host[port]
or 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()
ConnectionEndpointList.ConnectionEndpointList(Iterable)public ConnectionEndpointList(@NonNull ConnectionEndpoint... connectionEndpoints)
ConnectionEndpointList initialized with an array
of ConnectionEndpoints.connectionEndpoints - array of ConnectionEndpoints to add to this list.ConnectionEndpoint,
ConnectionEndpointList(Iterable)public ConnectionEndpointList(@NonNull Iterable<ConnectionEndpoint> connectionEndpoints)
ConnectionEndpointList initialized with the Iterable collection
of ConnectionEndpoints.connectionEndpoints - Iterable object containing ConnectionEndpoints
to add to this list.ConnectionEndpoint,
Iterable,
add(Iterable)public static ConnectionEndpointList from(ConnectionEndpoint... connectionEndpoints)
ConnectionEndpointList from an array of
ConnectionPoints.connectionEndpoints - array of ConnectionPoints
used to initialize a new instance of ConnectionEndpointList.ConnectionEndpointList initialized with the array of
ConnectionPoints.ConnectionEndpointpublic static ConnectionEndpointList from(InetSocketAddress... socketAddresses)
ConnectionEndpointList from an array of
InetSocketAddresses.socketAddresses - array of InetSocketAddresses
used to initialize a new instance of ConnectionEndpointList.ConnectionEndpointList initialized from the array of
InetSocketAddresses.InetSocketAddress,
from(Iterable)public static ConnectionEndpointList from(Iterable<InetSocketAddress> socketAddresses)
socketAddresses - Iterable of InetSocketAddresses
used to initialize a new instance of ConnectionEndpointList.ConnectionEndpointList initialized from an Iterable of
InetSocketAddresses.InetSocketAddress,
Iterablepublic static ConnectionEndpointList parse(String commaDelimitedHostAndPorts, int defaultPort)
hosts and ports in the format host[port]
or host:port to convert into an instance of ConnectionEndpointList.commaDelimitedHostAndPorts - String containing a comma-delimited String of hosts and ports.defaultPort - default port number to use if port is not specified in a host and port value.ConnectionEndpointList representing the hosts and ports.parse(int, String...)public static ConnectionEndpointList parse(int defaultPort, String... hostsPorts)
hosts and ports in the format host[port] or host:port
to convert into an instance of ConnectionEndpointList.defaultPort - default port number to use if port is not specified in a host and port value.hostsPorts - array of hosts and ports to parse.ConnectionEndpointList representing the hosts and ports in the array.ConnectionEndpoint.parse(String, int),
ConnectionEndpointList(Iterable)public boolean add(ConnectionEndpoint connectionEndpoint)
ConnectionEndpoint to this list.add in interface Collection<ConnectionEndpoint>add in interface List<ConnectionEndpoint>add in class AbstractList<ConnectionEndpoint>connectionEndpoint - ConnectionEndpoint to add to this list.ConnectionEndpoint,
add(ConnectionEndpoint...)public final ConnectionEndpointList add(ConnectionEndpoint... connectionEndpoints)
ConnectionEndpoints to this list.connectionEndpoints - array of ConnectionEndpoints to add to this list.ConnectionEndpointList.ConnectionEndpoint,
add(Iterable)public final ConnectionEndpointList add(Iterable<ConnectionEndpoint> connectionEndpoints)
Iterable collection of ConnectionEndpoints to this list.connectionEndpoints - Iterable collection of ConnectionEndpoints
to add to this list.ConnectionEndpointList.ConnectionEndpoint,
add(ConnectionEndpoint...)public void clear()
ConnectionEndpoints.clear in interface Collection<ConnectionEndpoint>clear in interface List<ConnectionEndpoint>clear in class AbstractList<ConnectionEndpoint>@NonNull public ConnectionEndpointList findBy(String host)
ConnectionEndpoints in this list with the specified hostname.host - String indicating the hostname to use in the match.ConnectionEndpointList (sub-List) containing all the ConnectionEndpoints
matching the given hostname.findBy(int)@NonNull public ConnectionEndpointList findBy(int port)
ConnectionEndpoints in this list with the specified port number.port - Integer value indicating the port number to use in the match.ConnectionEndpointList (sub-List) containing all the ConnectionEndpoints
matching the given port number.findBy(String)@Nullable 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)@Nullable 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>@NonNull 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>Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.