語言

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) 將文件從目前版本轉換到最終版本集。 映射的鍵是 Migrator 值所適用的結構型態。 這個值不可能為零值。

傳回

屬性

備註

設定遷徙者地圖。 映射的鍵是 Migrator 值所適用的結構型態。 Migrator 會將所有在特定結構類型下,透過 setVersion(int) 將目前 AppSearch 版本號遷移到最終版本集。 如果 AppSearch 中儲存的版本號與透過 setVersion(int) 設定的最終版本號不同,且 Migrator.shouldMigrate 回傳為真,則會呼叫 Migrator。 Migrator.onUpgrade 或 Migrator.onDowngrade 輸出 GenericDocument 的目標結構型別必須存在於此 SetSchemaRequest 中。

Android 參考資料。android.app.appsearch.SetSchemaRequest.Builder.setMigrators

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於