mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 10:51:27 +01:00
Migrate local account data into SignalStore.
This commit is contained in:
committed by
Cody Henthorne
parent
87f175a96b
commit
8aea20f147
@@ -0,0 +1,29 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public final class MockKeyValuePersistentStorage implements KeyValuePersistentStorage {
|
||||
|
||||
private final KeyValueDataSet dataSet;
|
||||
|
||||
public static KeyValuePersistentStorage withDataSet(@NonNull KeyValueDataSet dataSet) {
|
||||
return new MockKeyValuePersistentStorage(dataSet);
|
||||
}
|
||||
|
||||
private MockKeyValuePersistentStorage(@NonNull KeyValueDataSet dataSet) {
|
||||
this.dataSet = dataSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDataSet(@NonNull KeyValueDataSet dataSet, @NonNull Collection<String> removes) {
|
||||
this.dataSet.putAll(dataSet);
|
||||
this.dataSet.removeAll(removes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull KeyValueDataSet getDataSet() {
|
||||
return dataSet;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user