Class DefaultSyncConflictResolvers
- java.lang.Object
-
- com.mongodb.stitch.core.services.mongodb.remote.sync.DefaultSyncConflictResolvers
-
public final class DefaultSyncConflictResolvers extends Object
A collection of utility conflict resolvers.
-
-
Constructor Summary
Constructors Constructor Description DefaultSyncConflictResolvers()
-
Method Summary
Modifier and Type Method Description static <T> ConflictHandler<T>
localWins()
The local event will decide the next state of the document in question.static <T> ConflictHandler<T>
remoteWins()
The remote event will decide the next state of the document in question.
-
-
-
Method Detail
-
remoteWins
public static <T> ConflictHandler<T> remoteWins()
The remote event will decide the next state of the document in question.- Type Parameters:
T
- the type of class represented by the document in the change event.- Returns:
- the remote full document which may be null.
-
localWins
public static <T> ConflictHandler<T> localWins()
The local event will decide the next state of the document in question.- Type Parameters:
T
- the type of class represented by the document in the change event.- Returns:
- the local full document which may be null.
-
-