Package com.mongodb

Class ReadPreferenceHedgeOptions

java.lang.Object
com.mongodb.ReadPreferenceHedgeOptions

@Immutable public final class ReadPreferenceHedgeOptions extends Object
Options to apply to hedged reads in the server.
Since:
4.1
Since server release
4.4
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Gets whether hedged reads are enabled in the server.
      Returns:
      true if hedged reads are enabled in the server
    • builder

      public static ReadPreferenceHedgeOptions.Builder builder()
      Gets an instance of a builder
      Returns:
      a builder instance
    • toBsonDocument

      public BsonDocument toBsonDocument()
      Convert the hedge options to a BsonDocument.
      Returns:
      a BsonDocument containing the hedge options
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object