Package com.mongodb.selector
Class CompositeServerSelector
-
- com.mongodb.selector.CompositeServerSelector
-
- All Implemented Interfaces:
ServerSelector
public final class CompositeServerSelector extends implements ServerSelector
A server selector that composes a list of server selectors, and selects the servers by iterating through the list from start to finish, passing the result of the previous into the next, and finally returning the result of the last one.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description <? extends ServerSelector> serverSelectors)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
o)
<ServerSelector>
getServerSelectors()
int
hashCode()
<ServerDescription>
select(ClusterDescription clusterDescription)
Select a list of server descriptions from the given cluster description according to some criteria.toString()
-
-
-
Constructor Detail
-
CompositeServerSelector
public CompositeServerSelector(<? extends ServerSelector> serverSelectors)
Constructs a new instance.- Parameters:
serverSelectors
- the list of composed server selectors
-
-
Method Detail
-
getServerSelectors
public <ServerSelector> getServerSelectors()
- Returns:
- the server selectors list.
-
select
public <ServerDescription> select(ClusterDescription clusterDescription)
Description copied from interface:ServerSelector
Select a list of server descriptions from the given cluster description according to some criteria.- Specified by:
select
in interfaceServerSelector
- Parameters:
clusterDescription
- the cluster of servers to select from- Returns:
- a non-null list of ServerDescriptions that meet the requirements of this ServerSelector. This may be empty.
-
equals
public boolean equals( o)
- Overrides:
in class
-
hashCode
public int hashCode()
- Overrides:
in class
-
toString
public toString()
- Overrides:
in class
-
-