Package org.springframework.data.mongodb
Interface MongoTransactionOptions
- All Superinterfaces:
ReadConcernAware,ReadPreferenceAware,TransactionMetadata,WriteConcernAware
public interface MongoTransactionOptions
extends TransactionMetadata, ReadConcernAware, ReadPreferenceAware, WriteConcernAware
Options to be applied within a specific transaction scope.
- Since:
- 4.3
- Author:
- Christoph Strobl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MongoTransactionOptionsValue Object representing empty options enforcing client defaults. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Tmap(Function<MongoTransactionOptions, T> mappingFunction) Apply the current options using the given mappingFunctionand return its result.default MongoTransactionOptionsmergeWith(MongoTransactionOptions fallbackOptions) Merge current options with given ones.static MongoTransactionOptionsof(com.mongodb.TransactionOptions options) Factory method to wrap given MongoDB driver nativeTransactionOptionsintoMongoTransactionOptions.default com.mongodb.TransactionOptionsMethods inherited from interface org.springframework.data.mongodb.core.ReadConcernAware
getReadConcern, hasReadConcernMethods inherited from interface org.springframework.data.mongodb.core.ReadPreferenceAware
getReadPreference, hasReadPreferenceMethods inherited from interface org.springframework.data.mongodb.TransactionMetadata
getMaxCommitTime, hasMaxCommitTimeMethods inherited from interface org.springframework.data.mongodb.core.WriteConcernAware
getWriteConcern, hasWriteConcern
-
Field Details
-
NONE
Value Object representing empty options enforcing client defaults. Returns null for all getter methods.
-
-
Method Details
-
mergeWith
Merge current options with given ones. Will return first non null value from getters whereas the this has precedence over the given fallbackOptions.- Parameters:
fallbackOptions- can be null.- Returns:
- new instance of
MongoTransactionOptionsor this if fallbackOptions is null orNONE.
-
map
Apply the current options using the given mappingFunctionand return its result.- Parameters:
mappingFunction-- Returns:
- result of the mapping function.
-
toDriverOptions
- Returns:
- MongoDB driver native
TransactionOptions. - See Also:
-
of
Factory method to wrap given MongoDB driver nativeTransactionOptionsintoMongoTransactionOptions.- Parameters:
options-- Returns:
NONEif given object is null.
-