DocumentChangeInfo
public final class DocumentChangeInfo
Contains information about an individual change detected by an ObserverCallback.
This class reports information about document changes, that is, when documents were added, updated or removed.
Changes are grouped by package, database, schema type and namespace. Each unique combination of these items will generate a unique DocumentChangeInfo.
Notifications are only sent for documents whose schema type matches an observer's schema filters (as determined by getFilterSchemas).
Note that document changes that happen during schema migration from calling setSchemaAsync are not reported via this class. Such changes are reported through SchemaChangeInfo.
Summary
Public constructors |
|---|
DocumentChangeInfo(Constructs a new |
Public methods |
|
|---|---|
boolean |
|
@NonNull Set<String> |
Returns the set of document IDs that have been changed as part of this notification. |
@NonNull String |
Returns the database in which the documents that was changed reside. |
@NonNull String |
Returns the namespace of the documents that changed. |
@NonNull String |
Returns the package name of the app which owns the documents that changed. |
@NonNull String |
Returns the name of the schema type that contains the changed documents. |
int |
hashCode() |
@NonNull String |
toString() |
Public constructors
DocumentChangeInfo
public DocumentChangeInfo(
@NonNull String packageName,
@NonNull String database,
@NonNull String namespace,
@NonNull String schemaName,
@NonNull Set<String> changedDocumentIds
)
Constructs a new DocumentChangeInfo.
| Parameters | |
|---|---|
@NonNull String packageName |
The package name of the app which owns the documents that changed. |
@NonNull String database |
The database in which the documents that changed reside. |
@NonNull String namespace |
The namespace in which the documents that changed reside. |
@NonNull String schemaName |
The name of the schema type that contains the changed documents. |
@NonNull Set<String> changedDocumentIds |
The set of document IDs that have been changed as part of this notification. |
Public methods
getChangedDocumentIds
public @NonNull Set<String> getChangedDocumentIds()
Returns the set of document IDs that have been changed as part of this notification.
This will never be empty.
getDatabaseName
public @NonNull String getDatabaseName()
Returns the database in which the documents that was changed reside.
getNamespace
public @NonNull String getNamespace()
Returns the namespace of the documents that changed.
getPackageName
public @NonNull String getPackageName()
Returns the package name of the app which owns the documents that changed.
getSchemaName
public @NonNull String getSchemaName()
Returns the name of the schema type that contains the changed documents.