Language

SetSchemaRequest.Builder.SetMigrators Method

Definition

Adds or replaces migrators for the schema types in the map.

[Android.Runtime.Register("setMigrators", "(Ljava/util/Map;)Landroid/app/appsearch/SetSchemaRequest$Builder;", "", ApiSince=31)]
public Android.App.AppSearch.SetSchemaRequest.Builder SetMigrators(System.Collections.Generic.IDictionary<string,Android.App.AppSearch.Migrator> migrators);
[<Android.Runtime.Register("setMigrators", "(Ljava/util/Map;)Landroid/app/appsearch/SetSchemaRequest$Builder;", "", ApiSince=31)>]
member this.SetMigrators : System.Collections.Generic.IDictionary<string, Android.App.AppSearch.Migrator> -> Android.App.AppSearch.SetSchemaRequest.Builder

Parameters

migrators
IDictionary<String,Migrator>

A map of migrators that translate a document from its current version to the final version set by SetVersion(Int32). Each key is the schema type to which its Migrator applies. This value cannot be null.

Returns

This builder instance.

Attributes

Remarks

Adds or replaces migrators for the schema types in the map. Migrators for other schema types are retained. 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.setMigrators.

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