语言

SetSchemaRequest.Builder.SetMigrators 方法

定义

设置迁移器对象的映射。

[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

参数

migrators
IDictionary<String,Migrator>

将文档从当前版本转换为通过 setVersion(int)设置的最终版本的迁移程序映射。 映射的键是迁移程序值应用于的架构类型。 此值不能为 null。

返回

此生成器实例。

特性

注解

设置迁移器对象的映射。 映射的键是迁移程序值应用于的架构类型。 迁移程序将给定架构类型下的所有 GenericDocument 对象从 AppSearch 中存储的当前版本号迁移到通过 setVersion(int) 设置的最终版本集。 如果 AppSearch 中存储的当前版本号不同于通过 setVersion(int) 设置的最终版本集,并且 Migrator.shouldMigrate 返回 true,将调用迁移程序。 Output GenericDocument of Migrator.onUpgrade 或 Migrator.onDowngrade 的目标架构类型必须存在于此 SetSchemaRequest 中。

Android 参考。android.app.appsearch.SetSchemaRequest.Builder.setMigrators

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于