DocumentChangeInfo

public final class DocumentChangeInfo extends Object

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 ObserverSpec.getFilterSchemas()).

Note that document changes that happen during schema migration from calling AppSearchClient.setSchema(SetSchemaRequest, String) are not reported via this class. Such changes are reported through SchemaChangeInfo.

Public Constructor Summary

DocumentChangeInfo(String packageName, String database, String namespace, String schemaName, Set<String> changedDocumentIds)
Constructs a new DocumentChangeInfo.

Public Method Summary

boolean
Set<String>
getChangedDocumentIds()
Returns the set of document IDs that have been changed as part of this notification.
String
getDatabaseName()
Returns the database in which the documents that was changed reside.
String
getNamespace()
Returns the namespace of the documents that changed.
String
getPackageName()
Returns the package name of the app which owns the documents that changed.
String
getSchemaName()
Returns the name of the schema type that contains the changed documents.
int
String

Inherited Method Summary

Public Constructors

public DocumentChangeInfo (String packageName, String database, String namespace, String schemaName, Set<String> changedDocumentIds)

Constructs a new DocumentChangeInfo.

Parameters
packageName The package name of the app which owns the documents that changed.
database The database in which the documents that changed reside.
namespace The namespace in which the documents that changed reside.
schemaName The name of the schema type that contains the changed documents.
changedDocumentIds The set of document IDs that have been changed as part of this notification.

Public Methods

public boolean equals (Object o)

public Set<String> getChangedDocumentIds ()

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

This will never be empty.

public String getDatabaseName ()

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

public String getNamespace ()

Returns the namespace of the documents that changed.

public String getPackageName ()

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

public String getSchemaName ()

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

public int hashCode ()

public String toString ()