Package com.mongodb
Class ServerApi.Builder
java.lang.Object
com.mongodb.ServerApi.Builder
- Enclosing class:
- ServerApi
A builder for
ServerApi
so that ServerApi
can be immutable, and to support easier construction
through chaining.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build an instance ofServerApi
.deprecationErrors
(boolean deprecationErrors) Sets whether the application requires use of deprecated server APIs to be reported as errors.strict
(boolean strict) Sets whether the application requires strict server API version enforcement.version
(ServerApiVersion version) Gets the server API version
-
Method Details
-
version
Gets the server API version- Parameters:
version
- the server API version- Returns:
- the server API version
-
deprecationErrors
Sets whether the application requires use of deprecated server APIs to be reported as errors.The default is false.
- Parameters:
deprecationErrors
- whether the application requires use of deprecated server APIs to be reported as errors- Returns:
- this
-
strict
Sets whether the application requires strict server API version enforcement.The default is false.
- Parameters:
strict
- whether the application requires strict server API version enforcement- Returns:
- this
-
build
Build an instance ofServerApi
.- Returns:
- the settings from this builder
-