@NotThreadSafe public static final class MongoClientSettings.Builder extends Object
MongoClientSettings so that MongoClientSettings can be immutable, and to support easier construction
through chaining.public MongoClientSettings.Builder clusterSettings(ClusterSettings clusterSettings)
clusterSettings - the cluster settingsthisMongoClientSettings.getClusterSettings()public MongoClientSettings.Builder socketSettings(SocketSettings socketSettings)
socketSettings - the socket settingsthisMongoClientSettings.getSocketSettings()public MongoClientSettings.Builder heartbeatSocketSettings(SocketSettings heartbeatSocketSettings)
heartbeatSocketSettings - the socket settingsthisMongoClientSettings.getHeartbeatSocketSettings()public MongoClientSettings.Builder connectionPoolSettings(ConnectionPoolSettings connectionPoolSettings)
connectionPoolSettings - the connection settingsthis()public MongoClientSettings.Builder serverSettings(ServerSettings serverSettings)
serverSettings - the server settingsthis()public MongoClientSettings.Builder sslSettings(SslSettings sslSettings)
sslSettings - the SSL settingsthis()public MongoClientSettings.Builder readPreference(ReadPreference readPreference)
readPreference - read preferencethisMongoClientSettings.getReadPreference()public MongoClientSettings.Builder writeConcern(WriteConcern writeConcern)
writeConcern - the write concernthisMongoClientSettings.getWriteConcern()public MongoClientSettings.Builder readConcern(ReadConcern readConcern)
readConcern - the read concernthispublic MongoClientSettings.Builder credentialList(List<MongoCredential> credentialList)
credentialList - the credential listthisMongoClientSettings.getCredentialList()public MongoClientSettings.Builder codecRegistry(CodecRegistry codecRegistry)
codecRegistry - the codec registrythisMongoClientSettings.getCodecRegistry()public MongoClientSettings.Builder streamFactoryFactory(StreamFactoryFactory streamFactoryFactory)
StreamFactory.streamFactoryFactory - the stream factory factorypublic MongoClientSettings.Builder addCommandListener(CommandListener commandListener)
commandListener - the command listenerpublic MongoClientSettings.Builder applicationName(String applicationName)
applicationName - the logical name of the application using this MongoClient. It may be null.
The UTF-8 encoding may not exceed 128 bytes.thisMongoClientSettings.getApplicationName()public MongoClientSettings build()
MongoClientSettings.