Package io.realm.mongodb.mongo.events
Class BaseChangeEvent<DocumentT>
- java.lang.Object
-
- io.realm.mongodb.mongo.events.BaseChangeEvent<DocumentT>
-
- Type Parameters:
DocumentT
- The type of the full document in the change event.
public abstract class BaseChangeEvent<DocumentT> extends Object
Represents the set of properties that exist on all MongoDB realm change events produced by watch streams in this SDK. Other change event types inherit from this type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BaseChangeEvent.OperationType
Represents the different MongoDB operations that can occur.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BsonDocument
getDocumentKey()
The unique identifier for the document that was actually changed.DocumentT
getFullDocument()
The full document at some point after the change has been applied.BaseChangeEvent.OperationType
getOperationType()
Returns the operation type of the change that triggered the change event.UpdateDescription
getUpdateDescription()
In the case of an update, the description of which fields have been added, removed or updated.boolean
hasUncommittedWrites()
Indicates a local change event that has not yet been synchronized with a remote data store.abstract BsonDocument
toBsonDocument()
Converts the change event to a BSON representation, as it would look on a MongoDB realm change stream, or a Realm compact watch stream.
-
-
-
Method Detail
-
getOperationType
public BaseChangeEvent.OperationType getOperationType()
Returns the operation type of the change that triggered the change event.- Returns:
- the operation type of this change event.
-
getFullDocument
@Nullable public DocumentT getFullDocument()
The full document at some point after the change has been applied.- Returns:
- the full document.
-
getDocumentKey
public BsonDocument getDocumentKey()
The unique identifier for the document that was actually changed.- Returns:
- the document key.
-
getUpdateDescription
@Nullable public UpdateDescription getUpdateDescription()
In the case of an update, the description of which fields have been added, removed or updated.- Returns:
- the update description.
-
hasUncommittedWrites
public boolean hasUncommittedWrites()
Indicates a local change event that has not yet been synchronized with a remote data store. Used only for the sync use case.- Returns:
- whether or not this change event represents uncommitted writes.
-
toBsonDocument
public abstract BsonDocument toBsonDocument()
Converts the change event to a BSON representation, as it would look on a MongoDB realm change stream, or a Realm compact watch stream.- Returns:
- The BSON document representation of the change event.
-
-