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 forServerApiso thatServerApican be immutable, and to support easier construction through chaining.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerApibuild()Build an instance ofServerApi.ServerApi.BuilderdeprecationErrors(boolean deprecationErrors)Sets whether the application requires use of deprecated server APIs to be reported as errors.ServerApi.Builderstrict(boolean strict)Sets whether the application requires strict server API version enforcement.ServerApi.Builderversion(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
-
-