RxSharedPreferencesMigrationBuilder


class RxSharedPreferencesMigrationBuilderAny?>

RxSharedPreferencesMigrationBuilder for the RxSharedPreferencesMigration.

Summary

Public constructors

Any?> RxSharedPreferencesMigrationBuilder(
    context: Context,
    sharedPreferencesName: String,
    rxSharedPreferencesMigration: RxSharedPreferencesMigration
)

Public functions

DataMigration

Build and return the DataMigration instance.

RxSharedPreferencesMigrationBuilder
setKeysToMigrate(vararg keys: String)

Set the list of keys to migrate.

Public constructors

RxSharedPreferencesMigrationBuilder

Any?> RxSharedPreferencesMigrationBuilder(
    context: Context,
    sharedPreferencesName: String,
    rxSharedPreferencesMigration: RxSharedPreferencesMigration
)

Public functions

build

Added in 1.0.0
fun build(): DataMigration

Build and return the DataMigration instance.

Returns
DataMigration

the DataMigration.

setKeysToMigrate

Added in 1.0.0
fun setKeysToMigrate(vararg keys: String): RxSharedPreferencesMigrationBuilder

Set the list of keys to migrate. The keys will be mapped to datastore.Preferences with their same values. If the key is already present in the new Preferences, the key will not be migrated again. If the key is not present in the SharedPreferences it will not be migrated.

This method is optional and if keysToMigrate is not set, all keys will be migrated from the existing SharedPreferences.

Parameters
vararg keys: String

the keys to migrate