RxSharedPreferencesMigrationBuilder


class RxSharedPreferencesMigrationBuilder<T : Any?>


RxSharedPreferencesMigrationBuilder for the RxSharedPreferencesMigration.

Summary

Public constructors

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

Public functions

DataMigration<T>

Build and return the DataMigration instance.

RxSharedPreferencesMigrationBuilder<T>
setKeysToMigrate(vararg keys: String)

Set the list of keys to migrate.

Public constructors

RxSharedPreferencesMigrationBuilder

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

Public functions

build

Added in 1.0.0
fun build(): DataMigration<T>

Build and return the DataMigration instance.

Returns
DataMigration<T>

the DataMigration.

setKeysToMigrate

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

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