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(
    @NonNull String packageName,
    @NonNull String database,
    @NonNull String namespace,
    @NonNull String schemaName,
    @NonNull Set<String> changedDocumentIds
)

Constructs a new DocumentChangeInfo.

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
@NonNull String

Public constructors

DocumentChangeInfo

Added in 1.1.0-alpha06
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

equals

public boolean equals(@Nullable Object o)

getChangedDocumentIds

Added in 1.1.0-alpha06
public @NonNull Set<StringgetChangedDocumentIds()

Returns the set of document IDs that have been changed as part of this notification.

This will never be empty.

getDatabaseName

Added in 1.1.0-alpha06
public @NonNull String getDatabaseName()

Returns the database in which the documents that was changed reside.

getNamespace

Added in 1.1.0-alpha06
public @NonNull String getNamespace()

Returns the namespace of the documents that changed.

getPackageName

Added in 1.1.0-alpha06
public @NonNull String getPackageName()

Returns the package name of the app which owns the documents that changed.

getSchemaName

Added in 1.1.0-alpha06
public @NonNull String getSchemaName()

Returns the name of the schema type that contains the changed documents.

hashCode

public int hashCode()

toString

public @NonNull String toString()