Package com.mongodb

Class ServerApi


  • public final class ServerApi
    extends Object
    A specification of the server API on which the application relies.
    Since:
    4.3
    • 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 a Builder for instances of this class.
        Returns:
        the builder
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object