Package com.mongodb
Class ServerApi
- java.lang.Object
-
- com.mongodb.ServerApi
-
public final class ServerApi extends Object
A specification of the server API on which the application relies.- Since:
- 4.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServerApi.Builder
A builder forServerApi
so thatServerApi
can be immutable, and to support easier construction through chaining.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServerApi.Builder
builder()
Gets aBuilder
for instances of this class.boolean
equals(Object o)
Optional<Boolean>
getDeprecationErrors()
Gets whether the application requires use of deprecated server APIs to be reported as errors.Optional<Boolean>
getStrict()
Gets whether the application requires strict server API version enforcement.ServerApiVersion
getVersion()
Gets the server API versionint
hashCode()
String
toString()
-
-
-
Method Detail
-
getVersion
public ServerApiVersion getVersion()
Gets the server API version- Returns:
- the server API version
-
getStrict
public Optional<Boolean> getStrict()
Gets whether the application requires strict server API version enforcement.The default is false.
- Returns:
- whether the application requires strict server API version enforcement
-
getDeprecationErrors
public Optional<Boolean> getDeprecationErrors()
Gets whether the application requires use of deprecated server APIs to be reported as errors.The default is false.
- Returns:
- whether the application requires use of deprecated server APIs to be reported as errors
-
builder
public static ServerApi.Builder builder()
Gets aBuilder
for instances of this class.- Returns:
- the builder
-
-