public class PreferoutinesExtrasKt
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
awaitEdits(android.content.SharedPreferences $receiver,
kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,? extends android.content.SharedPreferences.Editor> edits,
kotlin.coroutines.Continuation<? super java.lang.Boolean> p)
Apply a series of
edits to the preferences and then commit them in a suspending fashiong. |
static java.lang.Object |
awaitNonNullString(android.content.SharedPreferences $receiver,
java.lang.String key,
java.lang.String defaultValue,
kotlin.coroutines.Continuation<? super java.lang.String> p)
Retrieve a string value from the preferences. Since
defaultValue is not null, the return value won't be null. |
static java.lang.Object |
awaitNonNullStringSet(android.content.SharedPreferences $receiver,
java.lang.String key,
java.util.Set<java.lang.String> defaultValue,
kotlin.coroutines.Continuation<? super java.util.Set<java.lang.String>> p)
Retrieve a set of String values from the preferences. Since
defaultValue is not null, the returned set won't be
null. |
static kotlinx.coroutines.flow.Flow<java.lang.String> |
getNonNullStringFlow(android.content.SharedPreferences $receiver,
java.lang.String key,
java.lang.String defaultValue)
Continuously receive the string value associated with the given
key. Since defaultValue is not null, the emitted
value will never be null. |
static kotlinx.coroutines.flow.Flow<java.util.Set> |
getNonNullStringSetFlow(android.content.SharedPreferences $receiver,
java.lang.String key,
java.util.Set<java.lang.String> defaultValue)
Continuously receive a string set associated with the given
key. Since defaultValue is not null, the emitted set
will never be null. |
@Nullable
public static java.lang.Object awaitNonNullString(@NotNull
android.content.SharedPreferences $receiver,
@NotNull
java.lang.String key,
@NotNull
java.lang.String defaultValue,
@NotNull
kotlin.coroutines.Continuation<? super java.lang.String> p)
Retrieve a string value from the preferences. Since defaultValue is not null, the return value won't be null.
Retrieve the value associated with key, if it exists.
defaultValue.ClassCastException - if there is a preference with this name that is not a String.defaultValue,
key@Nullable
public static java.lang.Object awaitNonNullStringSet(@NotNull
android.content.SharedPreferences $receiver,
@NotNull
java.lang.String key,
@NotNull
java.util.Set<java.lang.String> defaultValue,
@NotNull
kotlin.coroutines.Continuation<? super java.util.Set<java.lang.String>> p)
Retrieve a set of String values from the preferences. Since defaultValue is not null, the returned set won't be
null.
Retrieve the set associated with key, if it exists.
defaultValue.ClassCastException - if there is a preference with this name that is not a {@link Set}.defaultValue,
key@FlowPreview
@NotNull
public static kotlinx.coroutines.flow.Flow<java.lang.String> getNonNullStringFlow(@NotNull
android.content.SharedPreferences $receiver,
@NotNull
java.lang.String key,
@NotNull
java.lang.String defaultValue)
Continuously receive the string value associated with the given key. Since defaultValue is not null, the emitted
value will never be null.
key. Emits the current value upon subscription, and emits the
new value each time it is updated. If the value is null or is later set to null or removed, the provided
defaultValue is emitted.ClassCastException - if there is a preference with this name that is not a String.key,
defaultValue@FlowPreview
@NotNull
public static kotlinx.coroutines.flow.Flow<java.util.Set> getNonNullStringSetFlow(@NotNull
android.content.SharedPreferences $receiver,
@NotNull
java.lang.String key,
@NotNull
java.util.Set<java.lang.String> defaultValue)
Continuously receive a string set associated with the given key. Since defaultValue is not null, the emitted set
will never be null.
key. Emits the current value upon subscription, and emits the
new value each time it is updated. If the value is null or is later set to null or removed, the provided
defaultValue is emitted.ClassCastException - if there is a preference with this name that is not a {@link Set}.key,
defaultValue@Nullable
public static java.lang.Object awaitEdits(@NotNull
android.content.SharedPreferences $receiver,
@NotNull
kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,? extends android.content.SharedPreferences.Editor> edits,
@NotNull
kotlin.coroutines.Continuation<? super java.lang.Boolean> p)
Apply a series of edits to the preferences and then commit them in a suspending fashiong.
Note that calls to SharedPreferences.Editor.remove and SharedPreferences.Editor.clear are executed first, regardless of what order they appear in the series of edits.
edits,
SharedPreferences.Editor.remove,
SharedPreferences.Editor.clear