Language

SetSchemaRequest.Builder.SetMigrator(String, Migrator) Method

Definition

Sets the Migrator associated with the given SchemaType.

[Android.Runtime.Register("setMigrator", "(Ljava/lang/String;Landroid/app/appsearch/Migrator;)Landroid/app/appsearch/SetSchemaRequest$Builder;", "", ApiSince=31)]
public Android.App.AppSearch.SetSchemaRequest.Builder SetMigrator(string schemaType, Android.App.AppSearch.Migrator migrator);
[<Android.Runtime.Register("setMigrator", "(Ljava/lang/String;Landroid/app/appsearch/Migrator;)Landroid/app/appsearch/SetSchemaRequest$Builder;", "", ApiSince=31)>]
member this.SetMigrator : string * Android.App.AppSearch.Migrator -> Android.App.AppSearch.SetSchemaRequest.Builder

Parameters

schemaType
String

The schema type to set migrator on. This value cannot be null.

migrator
Migrator

The migrator translates a document from its current version to the final version set by SetVersion(Int32). This value cannot be null.

Returns

This builder instance.

Attributes

Remarks

Sets the Migrator associated with the given SchemaType. The Migrator migrates all GenericDocument objects under the given schema type from the current version stored in AppSearch to the final version set by SetVersion(Int32). A Migrator is invoked if the schema type exists, the current and final versions differ, and ShouldMigrate(Int32, Int32) returns true. The target schema type of the output GenericDocument from OnUpgrade(Int32, Int32, GenericDocument) or OnDowngrade(Int32, Int32, GenericDocument) must exist in this SetSchemaRequest.

Android reference for android.app.appsearch.SetSchemaRequest.Builder.setMigrator.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to