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 via setVersion(int). This value cannot be null.

Returns

Attributes

Remarks

Sets the Migrator associated with the given SchemaType. The Migrator migrates all GenericDocument s under given schema type from the current version number stored in AppSearch to the final version set via setVersion(int). A Migrator will be invoked if the current version number stored in AppSearch is different from the final version set via setVersion(int) and Migrator.shouldMigrate returns true. The target schema type of the output GenericDocument of Migrator.onUpgrade or Migrator.onDowngrade 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