Class ConnectionEndpointList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<ConnectionEndpoint>
org.springframework.data.gemfire.support.ConnectionEndpointList
- All Implemented Interfaces:
Iterable<ConnectionEndpoint>
,Collection<ConnectionEndpoint>
,List<ConnectionEndpoint>
- Since:
- 1.6.3
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionConstructs a new, empty and uninitialized instance of theConnectionEndpointList
.ConnectionEndpointList
(Iterable<ConnectionEndpoint> connectionEndpoints) Constructs a new instance ofConnectionEndpointList
initialized with theIterable
collection ofConnectionEndpoints
.ConnectionEndpointList
(ConnectionEndpoint... connectionEndpoints) Constructs a new instance ofConnectionEndpointList
initialized with an array ofConnectionEndpoints
. -
Method Summary
Modifier and TypeMethodDescriptionfinal ConnectionEndpointList
add
(Iterable<ConnectionEndpoint> connectionEndpoints) Adds theIterable
collection ofConnectionEndpoints
to this list.boolean
add
(ConnectionEndpoint connectionEndpoint) Adds the givenConnectionEndpoint
to this list.final ConnectionEndpointList
add
(ConnectionEndpoint... connectionEndpoints) Adds the array ofConnectionEndpoints
to this list.void
clear()
Clears the current list ofConnectionEndpoints
.findBy
(int port) Finds allConnectionEndpoints
in this list with the specified port number.Finds allConnectionEndpoints
in this list with the specifiedhostname
.findOne
(int port) Finds the firstConnectionEndpoint
in the collection with the given port.Finds the firstConnectionEndpoint
in the collection with the given host.static ConnectionEndpointList
from
(Iterable<InetSocketAddress> socketAddresses) static ConnectionEndpointList
from
(InetSocketAddress... socketAddresses) Factory method used to create aConnectionEndpointList
from an array ofInetSocketAddresses
.static ConnectionEndpointList
from
(ConnectionEndpoint... connectionEndpoints) Factory method used to create aConnectionEndpointList
from an array ofConnectionPoints
.get
(int index) Gets theConnectionEndpoint
at the given index in this list.boolean
isEmpty()
Determines whether this collection contains any ConnectionEndpoints.iterator()
static ConnectionEndpointList
Parses the array ofhosts and ports
in the format host[port] or host:port to convert into an instance ofConnectionEndpointList
.static ConnectionEndpointList
Parses the comma-delimitedhosts and ports
in the format host[port] or host:port to convert into an instance ofConnectionEndpointList
.set
(int index, ConnectionEndpoint element) Sets the element at the given index in this list to the givenConnectionEndpoint
.int
size()
Determines the number of ConnectionEndpoints contained in this collection.toArray()
Converts this collection ofConnectionEndpoint
s into an array ofConnectionEndpoint
s.toString()
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray
-
Constructor Details
-
ConnectionEndpointList
public ConnectionEndpointList()Constructs a new, empty and uninitialized instance of theConnectionEndpointList
.- See Also:
-
ConnectionEndpointList
Constructs a new instance ofConnectionEndpointList
initialized with an array ofConnectionEndpoints
.- Parameters:
connectionEndpoints
- array ofConnectionEndpoints
to add to this list.- See Also:
-
ConnectionEndpointList
Constructs a new instance ofConnectionEndpointList
initialized with theIterable
collection ofConnectionEndpoints
.- Parameters:
connectionEndpoints
-Iterable
object containingConnectionEndpoints
to add to this list.- See Also:
-
-
Method Details
-
from
Factory method used to create aConnectionEndpointList
from an array ofConnectionPoints
.- Parameters:
connectionEndpoints
- array ofConnectionPoints
used to initialize a new instance ofConnectionEndpointList
.- Returns:
- a
ConnectionEndpointList
initialized with the array ofConnectionPoints
. - See Also:
-
from
Factory method used to create aConnectionEndpointList
from an array ofInetSocketAddresses
.- Parameters:
socketAddresses
- array ofInetSocketAddresses
used to initialize a new instance ofConnectionEndpointList
.- Returns:
- a
ConnectionEndpointList
initialized from the array ofInetSocketAddresses
. - See Also:
-
from
- Parameters:
socketAddresses
-Iterable
ofInetSocketAddresses
used to initialize a new instance ofConnectionEndpointList
.- Returns:
- a
ConnectionEndpointList
initialized from anIterable
ofInetSocketAddresses
. - See Also:
-
parse
Parses the comma-delimitedhosts and ports
in the format host[port] or host:port to convert into an instance ofConnectionEndpointList
.- Parameters:
commaDelimitedHostAndPorts
-String
containing a comma-delimitedString
of hosts and ports.defaultPort
-default port number
to use if port is not specified in a host and port value.- Returns:
- a new
ConnectionEndpointList
representing thehosts and ports
. - See Also:
-
parse
Parses the array ofhosts and ports
in the format host[port] or host:port to convert into an instance ofConnectionEndpointList
.- Parameters:
defaultPort
-default port number
to use if port is not specified in a host and port value.hostsPorts
- array ofhosts and ports
to parse.- Returns:
- a new
ConnectionEndpointList
representing thehosts and ports
in the array. - See Also:
-
add
Adds the givenConnectionEndpoint
to this list.- Specified by:
add
in interfaceCollection<ConnectionEndpoint>
- Specified by:
add
in interfaceList<ConnectionEndpoint>
- Overrides:
add
in classAbstractList<ConnectionEndpoint>
- Parameters:
connectionEndpoint
-ConnectionEndpoint
to add to this list.- Returns:
- a boolean value indicating whether this list was modified by the add operation.
- See Also:
-
add
Adds the array ofConnectionEndpoints
to this list.- Parameters:
connectionEndpoints
- array ofConnectionEndpoints
to add to this list.- Returns:
- this
ConnectionEndpointList
. - See Also:
-
add
Adds theIterable
collection ofConnectionEndpoints
to this list.- Parameters:
connectionEndpoints
-Iterable
collection ofConnectionEndpoints
to add to this list.- Returns:
- this
ConnectionEndpointList
. - See Also:
-
clear
public void clear()Clears the current list ofConnectionEndpoints
.- Specified by:
clear
in interfaceCollection<ConnectionEndpoint>
- Specified by:
clear
in interfaceList<ConnectionEndpoint>
- Overrides:
clear
in classAbstractList<ConnectionEndpoint>
-
findBy
Finds allConnectionEndpoints
in this list with the specifiedhostname
.- Parameters:
host
-String
indicating the hostname to use in the match.- Returns:
- a
ConnectionEndpointList
(sub-List) containing all theConnectionEndpoints
matching the givenhostname
. - See Also:
-
findBy
Finds allConnectionEndpoints
in this list with the specified port number.- Parameters:
port
-Integer
value indicating the port number to use in the match.- Returns:
- a
ConnectionEndpointList
(sub-List) containing all theConnectionEndpoints
matching the given port number. - See Also:
-
findOne
Finds the firstConnectionEndpoint
in the collection with the given host.- Parameters:
host
- a String indicating the hostname of theConnectionEndpoint
to find.- Returns:
- the first
ConnectionEndpoint
in this collection with the given host, or null if noConnectionEndpoint
exists with the given hostname. - See Also:
-
findOne
Finds the firstConnectionEndpoint
in the collection with the given port.- Parameters:
port
- an integer indicating the port number of theConnectionEndpoint
to find.- Returns:
- the first
ConnectionEndpoint
in this collection with the given port, or null if noConnectionEndpoint
exists with the given port number. - See Also:
-
get
Gets theConnectionEndpoint
at the given index in this list.- Specified by:
get
in interfaceList<ConnectionEndpoint>
- Specified by:
get
in classAbstractList<ConnectionEndpoint>
- Parameters:
index
- an integer value indicating the index of theConnectionEndpoint
of interest.- Returns:
- the
ConnectionEndpoint
at index in this list. - Throws:
IndexOutOfBoundsException
- if the index is not within the bounds of this list.- See Also:
-
set
Sets the element at the given index in this list to the givenConnectionEndpoint
.- Specified by:
set
in interfaceList<ConnectionEndpoint>
- Overrides:
set
in classAbstractList<ConnectionEndpoint>
- Parameters:
index
- the index in the list at which to set theConnectionEndpoint
.element
- theConnectionEndpoint
to set in this list at the given index.- Returns:
- the old
ConnectionEndpoint
at index in this list or null if noConnectionEndpoint
at index existed. - Throws:
IndexOutOfBoundsException
- if the index is not within the bounds of this list.- See Also:
-
isEmpty
public boolean isEmpty()Determines whether this collection contains any ConnectionEndpoints.- Specified by:
isEmpty
in interfaceCollection<ConnectionEndpoint>
- Specified by:
isEmpty
in interfaceList<ConnectionEndpoint>
- Overrides:
isEmpty
in classAbstractCollection<ConnectionEndpoint>
- Returns:
- a boolean value indicating whether this collection contains any ConnectionEndpoints.
-
iterator
- Specified by:
iterator
in interfaceCollection<ConnectionEndpoint>
- Specified by:
iterator
in interfaceIterable<ConnectionEndpoint>
- Specified by:
iterator
in interfaceList<ConnectionEndpoint>
- Overrides:
iterator
in classAbstractList<ConnectionEndpoint>
-
size
public int size()Determines the number of ConnectionEndpoints contained in this collection.- Specified by:
size
in interfaceCollection<ConnectionEndpoint>
- Specified by:
size
in interfaceList<ConnectionEndpoint>
- Specified by:
size
in classAbstractCollection<ConnectionEndpoint>
- Returns:
- an integer value indicating the number of ConnectionEndpoints contained in this collection.
-
toArray
Converts this collection ofConnectionEndpoint
s into an array ofConnectionEndpoint
s.- Specified by:
toArray
in interfaceCollection<ConnectionEndpoint>
- Specified by:
toArray
in interfaceList<ConnectionEndpoint>
- Overrides:
toArray
in classAbstractCollection<ConnectionEndpoint>
- Returns:
- an array of
ConnectionEndpoint
s representing this collection.
-
toInetSocketAddresses
- Returns:
- a
List
ofInetSocketAddress
es representing this collection ofConnectionEndpoint
s. - See Also:
-
toString
- Overrides:
toString
in classAbstractCollection<ConnectionEndpoint>
-