SetSchemaRequest.Builder.SetMigrator(String, Migrator) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定與該 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
參數
- schemaType
- String
要設定 Migrator 的 schema 類型。 這個值不可能為零值。
- migrator
- Migrator
遷移者會透過 setVersion(int) 將文件從目前版本翻譯到最終版本集。 這個值不可能為零值。
傳回
- 屬性
備註
設定與該 SchemaType 關聯的遷移者。 Migrator 會將所有在特定結構類型下,透過 setVersion(int) 將目前 AppSearch 版本號遷移到最終版本集。 如果 AppSearch 中儲存的版本號與透過 setVersion(int) 設定的最終版本號不同,且 Migrator.shouldMigrate 回傳為真,則會呼叫 Migrator。 Migrator.onUpgrade 或 Migrator.onDowngrade 輸出 GenericDocument 的目標結構型別必須存在於此 SetSchemaRequest 中。
Android 參考資料。android.app.appsearch.SetSchemaRequest.Builder.setMigrator
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。