SchemaChangeInfo

public final class SchemaChangeInfo


Contains information about a schema change detected by an ObserverCallback.

This object will be sent when a schema type having a name matching an observer's schema filters (as determined by getFilterSchemas) has been added, updated, or removed.

Note that schema changes may cause documents to be migrated or removed. When this happens, individual document updates will NOT be dispatched via DocumentChangeInfo. The only notification will be of the schema type change via SchemaChangeInfo. Depending on your use case, you may need to re-query the whole schema type when this happens.

Summary

Public constructors

SchemaChangeInfo(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull Set<String> changedSchemaNames
)

Constructs a new SchemaChangeInfo.

Public methods

boolean
@NonNull Set<String>

Returns the names of schema types affected by this change notification.

@NonNull String

Returns the database in which the schema that was changed resides.

@NonNull String

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

int
@NonNull String

Public constructors

SchemaChangeInfo

Added in 1.1.0-alpha04
public SchemaChangeInfo(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull Set<String> changedSchemaNames
)

Constructs a new SchemaChangeInfo.

Parameters
@NonNull String packageName

The package name of the app which owns the schema that changed.

@NonNull String databaseName

The database in which the schema that changed resides.

@NonNull Set<String> changedSchemaNames

Names of schemas that have changed as part of this notification.

Public methods

equals

public boolean equals(@Nullable Object o)

getChangedSchemaNames

Added in 1.1.0-alpha04
public @NonNull Set<StringgetChangedSchemaNames()

Returns the names of schema types affected by this change notification.

This will never be empty.

getDatabaseName

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

Returns the database in which the schema that was changed resides.

getPackageName

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

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

hashCode

public int hashCode()

toString

public @NonNull String toString()