diff --git a/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/EncryptedSharedPreferencesKeyValueStorage.kt b/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/EncryptedSharedPreferencesKeyValueStorage.kt index 65bbb7646..3ada22f51 100644 --- a/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/EncryptedSharedPreferencesKeyValueStorage.kt +++ b/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/EncryptedSharedPreferencesKeyValueStorage.kt @@ -37,7 +37,6 @@ class EncryptedSharedPreferencesKeyValueStorage @Inject constructor( is Long -> putLong(key.key.name, data) is Double -> putString(key.key.name, data.toString()) is ByteArray -> putString(key.key.name, data.toHexString()) - else -> throw IllegalArgumentException("Unsupported type") } } } @@ -56,10 +55,6 @@ class EncryptedSharedPreferencesKeyValueStorage @Inject constructor( is PreferenceKey.ByteArrayKey -> sharedPreferences.getString(key.key.name, null) ?.hexToByteArray() - - else -> { - throw IllegalArgumentException("Unsupported type") - } } as T? ) } @@ -77,10 +72,6 @@ class EncryptedSharedPreferencesKeyValueStorage @Inject constructor( is PreferenceKey.ByteArrayKey -> sharedPreferences.getString(key.key.name, null) ?.hexToByteArray() - - else -> { - throw IllegalArgumentException("Unsupported type") - } } as T? } diff --git a/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/PreferenceKey.kt b/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/PreferenceKey.kt index 400dd9580..27a24d284 100644 --- a/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/PreferenceKey.kt +++ b/modules/storage/src/main/kotlin/edu/stanford/spezi/modules/storage/key/PreferenceKey.kt @@ -8,7 +8,6 @@ import androidx.datastore.preferences.core.floatPreferencesKey import androidx.datastore.preferences.core.intPreferencesKey import androidx.datastore.preferences.core.longPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey -import androidx.datastore.preferences.core.stringSetPreferencesKey sealed class PreferenceKey(val key: Preferences.Key) { class IntKey(name: String) : PreferenceKey(intPreferencesKey(name)) @@ -17,6 +16,5 @@ sealed class PreferenceKey(val key: Preferences.Key) { class BooleanKey(name: String) : PreferenceKey(booleanPreferencesKey(name)) class FloatKey(name: String) : PreferenceKey(floatPreferencesKey(name)) class LongKey(name: String) : PreferenceKey(longPreferencesKey(name)) - class StringSetKey(name: String) : PreferenceKey>(stringSetPreferencesKey(name)) class ByteArrayKey(name: String) : PreferenceKey(byteArrayPreferencesKey(name)) }