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
  • Method Details

    • 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 a Builder for instances of this class.
      Returns:
      the builder
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object