DocumentChangeInfo
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 functions |
|
---|---|
Boolean |
|
(Mutable)Set<String!> |
Returns the set of document IDs that have been changed as part of this notification. |
String |
Returns the database in which the documents that was changed reside. |
String |
Returns the namespace of the documents that changed. |
String |
Returns the package name of the app which owns the documents that changed. |
String |
Returns the name of the schema type that contains the changed documents. |
Int |
hashCode() |
String |
toString() |
Public constructors
DocumentChangeInfo
DocumentChangeInfo(
packageName: String,
database: String,
namespace: String,
schemaName: String,
changedDocumentIds: (Mutable)Set<String!>
)
Constructs a new DocumentChangeInfo
.
Parameters | |
---|---|
packageName: String |
The package name of the app which owns the documents that changed. |
database: String |
The database in which the documents that changed reside. |
namespace: String |
The namespace in which the documents that changed reside. |
schemaName: String |
The name of the schema type that contains the changed documents. |
changedDocumentIds: (Mutable)Set<String!> |
The set of document IDs that have been changed as part of this notification. |
Public functions
getChangedDocumentIds
fun getChangedDocumentIds(): (Mutable)Set<String!>
Returns the set of document IDs that have been changed as part of this notification.
This will never be empty.
getDatabaseName
fun getDatabaseName(): String
Returns the database in which the documents that was changed reside.
getNamespace
fun getNamespace(): String
Returns the namespace of the documents that changed.
getPackageName
fun getPackageName(): String
Returns the package name of the app which owns the documents that changed.
getSchemaName
fun getSchemaName(): String
Returns the name of the schema type that contains the changed documents.