Package com.mongodb
Class ClientSessionOptions
- java.lang.Object
-
- com.mongodb.ClientSessionOptions
-
@Immutable public final class ClientSessionOptions extends java.lang.Object
The options to apply to aClientSession
.- Since:
- 3.6
- See Also:
ClientSession
- MongoDB documentation
- Causal Consistency
- Since server release
- 3.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientSessionOptions.Builder
A builder for instances ofClientSession
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientSessionOptions.Builder
builder()
Gets an instance of a builderstatic ClientSessionOptions.Builder
builder(ClientSessionOptions options)
Gets an instance of a builder initialized with the given optionsboolean
equals(java.lang.Object o)
TransactionOptions
getDefaultTransactionOptions()
Gets the default transaction options for the session.int
hashCode()
java.lang.Boolean
isCausallyConsistent()
Whether operations using the session should causally consistent with each other.java.lang.String
toString()
-
-
-
Method Detail
-
isCausallyConsistent
@Nullable public java.lang.Boolean isCausallyConsistent()
Whether operations using the session should causally consistent with each other.- Returns:
- whether operations using the session should be causally consistent. A null value indicates to use the global default, which is currently true.
- MongoDB documentation
- Causal Consistency
-
getDefaultTransactionOptions
public TransactionOptions getDefaultTransactionOptions()
Gets the default transaction options for the session.- Returns:
- the default transaction options for the session
- Since:
- 3.8
- Since server release
- 4.0
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static ClientSessionOptions.Builder builder()
Gets an instance of a builder- Returns:
- a builder instance
-
builder
public static ClientSessionOptions.Builder builder(ClientSessionOptions options)
Gets an instance of a builder initialized with the given options- Parameters:
options
- the options with which to initialize the builder- Returns:
- a builder instance
- Since:
- 3.8
-
-