SharedPreferencesUtil

Utility functions for easier handling of shared preferences

Functions

Link copied to clipboard
@Contract(value = "_, _ -> new", pure = true)
open fun container(@NonNull context: Context, @NonNull name: String): SharedPreferences
Loads shared preferences container
Link copied to clipboard
@Contract(value = "_, _ -> new", pure = true)
open fun lazyContainer(@NonNull context: Supplier<Context>, @NonNull name: String): SharedPreferencesContainer
Loads shared preferences container with forced caching
Link copied to clipboard
open fun of(@NonNull context: Supplier<Context>, @NonNull preferences: Supplier<SharedPreferences>, @NonNull key: String, defValue: Float): Eventual<SharedPreference<Float>>
open fun of(@NonNull context: Supplier<Context>, @NonNull preferences: Supplier<SharedPreferences>, @NonNull key: String, defValue: Int): Eventual<SharedPreference<Integer>>
open fun of(@NonNull context: Supplier<Context>, @NonNull preferences: Supplier<SharedPreferences>, @NonNull key: String, defValue: Long): Eventual<SharedPreference<Long>>
Loads one preference from container.