Package com.mongodb
Class ServerApi.Builder
- java.lang.Object
-
- com.mongodb.ServerApi.Builder
-
- Enclosing class:
- ServerApi
@NotThreadSafe public static final class ServerApi.Builder extends Object
A builder forServerApi
so thatServerApi
can be immutable, and to support easier construction through chaining.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerApi
build()
Build an instance ofServerApi
.ServerApi.Builder
deprecationErrors(boolean deprecationErrors)
Sets whether the application requires use of deprecated server APIs to be reported as errors.ServerApi.Builder
strict(boolean strict)
Sets whether the application requires strict server API version enforcement.ServerApi.Builder
version(ServerApiVersion version)
Gets the server API version
-
-
-
Method Detail
-
version
public ServerApi.Builder version(ServerApiVersion version)
Gets the server API version- Parameters:
version
- the server API version- Returns:
- the server API version
-
deprecationErrors
public ServerApi.Builder deprecationErrors(boolean 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
public ServerApi.Builder strict(boolean 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
public ServerApi build()
Build an instance ofServerApi
.- Returns:
- the settings from this builder
-
-