SavedStateReader



An inline class that encapsulates an opaque SavedState, and provides an API for reading the platform specific state.

See also
read

Summary

Public functions

inline operator Boolean

Checks if the SavedState contains the specified key.

Cmn
android
Boolean

Checks if the two specified SavedState are deeply equal to one another.

Cmn
android
Int

Returns a hash code based on the "deep contents" of specified SavedState.

Cmn
android
inline IBinder

Retrieves an IBinder object associated with the specified key.

android
inline IBinder
getBinderOrElse(key: String, defaultValue: () -> IBinder)

Retrieves an IBinder value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

android
inline Boolean

Retrieves a Boolean value associated with the specified key.

Cmn
android
inline BooleanArray

Retrieves a BooleanArray value associated with the specified key.

Cmn
android
inline BooleanArray
getBooleanArrayOrElse(key: String, defaultValue: () -> BooleanArray)

Retrieves a BooleanArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Boolean
getBooleanOrElse(key: String, defaultValue: () -> Boolean)

Retrieves a Boolean value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline Char

Retrieves a Char value associated with the specified key.

Cmn
android
inline CharArray

Retrieves a CharArray value associated with the specified key.

Cmn
android
inline CharArray
getCharArrayOrElse(key: String, defaultValue: () -> CharArray)

Retrieves a CharArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Char
getCharOrElse(key: String, defaultValue: () -> Char)

Retrieves a Char value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline CharSequence

Retrieves a CharSequence value associated with the specified key.

Cmn
android
inline Array<CharSequence>

Retrieves a CharArray value associated with the specified key.

Cmn
android
inline Array<CharSequence>
getCharSequenceArrayOrElse(
    key: String,
    defaultValue: () -> Array<CharSequence>
)

Retrieves a CharArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline List<CharSequence>

Retrieves a List of elements of CharArray associated with the specified key.

Cmn
android
inline List<CharSequence>
getCharSequenceListOrElse(
    key: String,
    defaultValue: () -> List<CharSequence>
)

Retrieves a List of elements of CharSequence associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline CharSequence
getCharSequenceOrElse(key: String, defaultValue: () -> CharSequence)

Retrieves a CharSequence value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline Double

Retrieves a Double value associated with the specified key.

Cmn
android
inline DoubleArray

Retrieves a DoubleArray value associated with the specified key.

Cmn
android
inline DoubleArray
getDoubleArrayOrElse(key: String, defaultValue: () -> DoubleArray)

Retrieves a DoubleArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Double
getDoubleOrElse(key: String, defaultValue: () -> Double)

Retrieves a Double value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline Float

Retrieves a Float value associated with the specified key.

Cmn
android
inline FloatArray

Retrieves a FloatArray value associated with the specified key.

Cmn
android
inline FloatArray
getFloatArrayOrElse(key: String, defaultValue: () -> FloatArray)

Retrieves a FloatArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Float
getFloatOrElse(key: String, defaultValue: () -> Float)

Retrieves a Float value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline Int
getInt(key: String)

Retrieves an Int value associated with the specified key.

Cmn
android
inline IntArray

Retrieves a IntArray value associated with the specified key.

Cmn
android
inline IntArray
getIntArrayOrElse(key: String, defaultValue: () -> IntArray)

Retrieves a IntArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline List<Int>

Retrieves a List of elements of Int associated with the specified key.

Cmn
android
inline List<Int>
getIntListOrElse(key: String, defaultValue: () -> List<Int>)

Retrieves a List of elements of Int associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Int
getIntOrElse(key: String, defaultValue: () -> Int)

Retrieves a Int value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline T

Retrieves a Serializable object associated with the specified key.

android
inline T
<T : Serializable> getJavaSerializableOrElse(
    key: String,
    defaultValue: () -> T
)

Retrieves a Serializable value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

android
inline Long

Retrieves an Long value associated with the specified key.

Cmn
android
inline LongArray

Retrieves a LongArray value associated with the specified key.

Cmn
android
inline LongArray
getLongArrayOrElse(key: String, defaultValue: () -> LongArray)

Retrieves a LongArray value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Long
getLongOrElse(key: String, defaultValue: () -> Long)

Retrieves a Long value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline T

Retrieves a Parcelable object associated with the specified key.

android
inline Array<T>

Retrieves an Array of elements of Parcelable associated with the specified key.

android
inline Array<T>
<T : Parcelable> getParcelableArrayOrElse(
    key: String,
    defaultValue: () -> Array<T>
)

Retrieves a Array of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

android
inline List<T>

Retrieves a List of elements of Parcelable associated with the specified key.

android
inline List<T>
<T : Parcelable> getParcelableListOrElse(
    key: String,
    defaultValue: () -> List<T>
)

Retrieves a List of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

android
inline T
<T : Parcelable> getParcelableOrElse(key: String, defaultValue: () -> T)

Retrieves a Parcelable value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

android
inline SavedState

Retrieves a SavedState object associated with the specified key.

Cmn
android
inline SavedState
getSavedStateOrElse(key: String, defaultValue: () -> SavedState)

Retrieves a SavedState object associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline Size

Retrieves a Size object associated with the specified key.

android
inline SizeF

Retrieves a SizeF object associated with the specified key.

android
inline SizeF
getSizeFOrElse(key: String, defaultValue: () -> SizeF)

Retrieves a SizeF value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

android
inline Size
getSizeOrElse(key: String, defaultValue: () -> Size)

Retrieves a Size value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

android
inline SparseArray<T>

Retrieves a SparseArray of elements of Parcelable associated with the specified key.

android
inline SparseArray<T>
<T : Parcelable> getSparseParcelableArrayOrElse(
    key: String,
    defaultValue: () -> SparseArray<T>
)

Retrieves a SparseArray of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

android
inline String

Retrieves a String value associated with the specified key.

Cmn
android
inline Array<String>

Retrieves a Array of String value associated with the specified key.

Cmn
android
inline Array<String>
getStringArrayOrElse(key: String, defaultValue: () -> Array<String>)

Retrieves a Array of String value associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline List<String>

Retrieves a List of elements of String associated with the specified key.

Cmn
android
inline List<String>
getStringListOrElse(key: String, defaultValue: () -> List<String>)

Retrieves a List of elements of String associated with the specified key, or a default value if the key doesn't exist.

Cmn
android
inline String
getStringOrElse(key: String, defaultValue: () -> String)

Retrieves a String value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Cmn
android
inline Boolean

Checks if the SavedState is empty (contains no key-value pairs).

Cmn
android
inline Boolean
isNull(key: String)

Checks if the SavedState contains a null reference for the specified key.

Cmn
android
inline Int

Returns the number of key-value pairs in the SavedState.

Cmn
android
Map<StringAny?>

Returns a new Map containing all key-value pairs from the SavedState.

Cmn
android

Public functions

contains

inline operator fun contains(key: String): Boolean

Checks if the SavedState contains the specified key.

Parameters
key: String

The key to check for.

Returns
Boolean

true if the SavedState contains the key, false otherwise.

contentDeepEquals

fun contentDeepEquals(other: SavedState): Boolean

Checks if the two specified SavedState are deeply equal to one another.

Two SavedState are considered deeply equal if they have the same size, and elements at corresponding keys are deeply equal. That is, if two corresponding elements are nested SavedState, they are also compared deeply.

If any of SavedState contains itself on any nesting level the behavior is undefined.

Parameters
other: SavedState

the object to compare deeply with this.

Returns
Boolean

true if the two are deeply equal, false otherwise.

contentDeepHashCode

fun contentDeepHashCode(): Int

Returns a hash code based on the "deep contents" of specified SavedState. If the SavedState contains other SavedState as elements, the hash code is based on their contents and so on.

The computation of the hash code returned is as if the SavedState is a List. Nested SavedState are treated as lists too.

If any of SavedState contains itself on any nesting level the behavior is undefined.

Returns
Int

a deep-content-based hash code for SavedState.

getBinder

inline fun getBinder(key: String): IBinder

Retrieves an IBinder object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
IBinder

The value associated with the key.

Throws
kotlin.IllegalStateException

If the key is not found.

getBinderOrElse

inline fun getBinderOrElse(key: String, defaultValue: () -> IBinder): IBinder

Retrieves an IBinder value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> IBinder

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
IBinder

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getBoolean

inline fun getBoolean(key: String): Boolean

Retrieves a Boolean value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Boolean

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getBooleanArray

inline fun getBooleanArray(key: String): BooleanArray

Retrieves a BooleanArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
BooleanArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getBooleanArrayOrElse

inline fun getBooleanArrayOrElse(key: String, defaultValue: () -> BooleanArray): BooleanArray

Retrieves a BooleanArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> BooleanArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
BooleanArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getBooleanOrElse

inline fun getBooleanOrElse(key: String, defaultValue: () -> Boolean): Boolean

Retrieves a Boolean value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Boolean

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Boolean

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getChar

inline fun getChar(key: String): Char

Retrieves a Char value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Char

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getCharArray

inline fun getCharArray(key: String): CharArray

Retrieves a CharArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
CharArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getCharArrayOrElse

inline fun getCharArrayOrElse(key: String, defaultValue: () -> CharArray): CharArray

Retrieves a CharArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> CharArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
CharArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getCharOrElse

inline fun getCharOrElse(key: String, defaultValue: () -> Char): Char

Retrieves a Char value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Char

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Char

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getCharSequence

inline fun getCharSequence(key: String): CharSequence

Retrieves a CharSequence value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
CharSequence

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getCharSequenceArray

inline fun getCharSequenceArray(key: String): Array<CharSequence>

Retrieves a CharArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Array<CharSequence>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getCharSequenceArrayOrElse

inline fun getCharSequenceArrayOrElse(
    key: String,
    defaultValue: () -> Array<CharSequence>
): Array<CharSequence>

Retrieves a CharArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Array<CharSequence>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Array<CharSequence>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getCharSequenceList

inline fun getCharSequenceList(key: String): List<CharSequence>

Retrieves a List of elements of CharArray associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
List<CharSequence>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getCharSequenceListOrElse

inline fun getCharSequenceListOrElse(
    key: String,
    defaultValue: () -> List<CharSequence>
): List<CharSequence>

Retrieves a List of elements of CharSequence associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> List<CharSequence>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
List<CharSequence>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getCharSequenceOrElse

inline fun getCharSequenceOrElse(key: String, defaultValue: () -> CharSequence): CharSequence

Retrieves a CharSequence value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> CharSequence

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
CharSequence

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getDouble

inline fun getDouble(key: String): Double

Retrieves a Double value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Double

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getDoubleArray

inline fun getDoubleArray(key: String): DoubleArray

Retrieves a DoubleArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
DoubleArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getDoubleArrayOrElse

inline fun getDoubleArrayOrElse(key: String, defaultValue: () -> DoubleArray): DoubleArray

Retrieves a DoubleArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> DoubleArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
DoubleArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getDoubleOrElse

inline fun getDoubleOrElse(key: String, defaultValue: () -> Double): Double

Retrieves a Double value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Double

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Double

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getFloat

inline fun getFloat(key: String): Float

Retrieves a Float value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Float

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getFloatArray

inline fun getFloatArray(key: String): FloatArray

Retrieves a FloatArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
FloatArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getFloatArrayOrElse

inline fun getFloatArrayOrElse(key: String, defaultValue: () -> FloatArray): FloatArray

Retrieves a FloatArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> FloatArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
FloatArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getFloatOrElse

inline fun getFloatOrElse(key: String, defaultValue: () -> Float): Float

Retrieves a Float value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Float

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Float

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getInt

inline fun getInt(key: String): Int

Retrieves an Int value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Int

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getIntArray

inline fun getIntArray(key: String): IntArray

Retrieves a IntArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
IntArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getIntArrayOrElse

inline fun getIntArrayOrElse(key: String, defaultValue: () -> IntArray): IntArray

Retrieves a IntArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> IntArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
IntArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getIntList

inline fun getIntList(key: String): List<Int>

Retrieves a List of elements of Int associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
List<Int>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getIntListOrElse

inline fun getIntListOrElse(key: String, defaultValue: () -> List<Int>): List<Int>

Retrieves a List of elements of Int associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> List<Int>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
List<Int>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getIntOrElse

inline fun getIntOrElse(key: String, defaultValue: () -> Int): Int

Retrieves a Int value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Int

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Int

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getJavaSerializable

inline fun <T : Serializable> getJavaSerializable(key: String): T

Retrieves a Serializable object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
T

The value associated with the key.

Throws
kotlin.IllegalStateException

If the key is not found.

getJavaSerializableOrElse

inline fun <T : Serializable> getJavaSerializableOrElse(
    key: String,
    defaultValue: () -> T
): T

Retrieves a Serializable value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> T

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
T

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getLong

inline fun getLong(key: String): Long

Retrieves an Long value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Long

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

getLongArray

inline fun getLongArray(key: String): LongArray

Retrieves a LongArray value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
LongArray

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getLongArrayOrElse

inline fun getLongArrayOrElse(key: String, defaultValue: () -> LongArray): LongArray

Retrieves a LongArray value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> LongArray

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
LongArray

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getLongOrElse

inline fun getLongOrElse(key: String, defaultValue: () -> Long): Long

Retrieves a Long value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Long

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Long

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getParcelable

inline fun <T : Parcelable> getParcelable(key: String): T

Retrieves a Parcelable object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
T

The value associated with the key.

Throws
kotlin.IllegalStateException

If the key is not found.

getParcelableArray

inline fun <T : Parcelable> getParcelableArray(key: String): Array<T>

Retrieves an Array of elements of Parcelable associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Array<T>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getParcelableArrayOrElse

inline fun <T : Parcelable> getParcelableArrayOrElse(
    key: String,
    defaultValue: () -> Array<T>
): Array<T>

Retrieves a Array of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Array<T>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Array<T>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getParcelableList

inline fun <T : Parcelable> getParcelableList(key: String): List<T>

Retrieves a List of elements of Parcelable associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
List<T>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getParcelableListOrElse

inline fun <T : Parcelable> getParcelableListOrElse(
    key: String,
    defaultValue: () -> List<T>
): List<T>

Retrieves a List of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> List<T>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
List<T>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getParcelableOrElse

inline fun <T : Parcelable> getParcelableOrElse(key: String, defaultValue: () -> T): T

Retrieves a Parcelable value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> T

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
T

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getSavedState

inline fun getSavedState(key: String): SavedState

Retrieves a SavedState object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
SavedState

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getSavedStateOrElse

inline fun getSavedStateOrElse(key: String, defaultValue: () -> SavedState): SavedState

Retrieves a SavedState object associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> SavedState

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
SavedState

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getSize

inline fun getSize(key: String): Size

Retrieves a Size object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Size

The value associated with the key.

Throws
kotlin.IllegalStateException

If the key is not found.

getSizeF

inline fun getSizeF(key: String): SizeF

Retrieves a SizeF object associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
SizeF

The value associated with the key.

Throws
kotlin.IllegalStateException

If the key is not found.

getSizeFOrElse

inline fun getSizeFOrElse(key: String, defaultValue: () -> SizeF): SizeF

Retrieves a SizeF value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> SizeF

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
SizeF

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getSizeOrElse

inline fun getSizeOrElse(key: String, defaultValue: () -> Size): Size

Retrieves a Size value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Size

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Size

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getSparseParcelableArray

inline fun <T : Parcelable> getSparseParcelableArray(key: String): SparseArray<T>

Retrieves a SparseArray of elements of Parcelable associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
SparseArray<T>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getSparseParcelableArrayOrElse

inline fun <T : Parcelable> getSparseParcelableArrayOrElse(
    key: String,
    defaultValue: () -> SparseArray<T>
): SparseArray<T>

Retrieves a SparseArray of elements of Parcelable associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> SparseArray<T>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
SparseArray<T>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getString

inline fun getString(key: String): String

Retrieves a String value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
String

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getStringArray

inline fun getStringArray(key: String): Array<String>

Retrieves a Array of String value associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
Array<String>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getStringArrayOrElse

inline fun getStringArrayOrElse(key: String, defaultValue: () -> Array<String>): Array<String>

Retrieves a Array of String value associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> Array<String>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
Array<String>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getStringList

inline fun getStringList(key: String): List<String>

Retrieves a List of elements of String associated with the specified key.

Parameters
key: String

The key to retrieve the value for.

Returns
List<String>

The value associated with the key.

Throws
kotlin.IllegalArgumentException

If the key is not found.

kotlin.IllegalStateException

if associated value has wrong type.

getStringListOrElse

inline fun getStringListOrElse(key: String, defaultValue: () -> List<String>): List<String>

Retrieves a List of elements of String associated with the specified key, or a default value if the key doesn't exist.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> List<String>

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
List<String>

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

getStringOrElse

inline fun getStringOrElse(key: String, defaultValue: () -> String): String

Retrieves a String value associated with the specified key, or returns defaultValue if the key is not found or the associated value has the wrong type.

Parameters
key: String

The key to retrieve the value for.

defaultValue: () -> String

A function providing the default value to return if the key is not found or the associated value has the wrong type.

Returns
String

The value associated with the key, or the result of defaultValue if the key is not found or the associated value has the wrong type.

isEmpty

inline fun isEmpty(): Boolean

Checks if the SavedState is empty (contains no key-value pairs).

Returns
Boolean

true if the SavedState is empty, false otherwise.

isNull

inline fun isNull(key: String): Boolean

Checks if the SavedState contains a null reference for the specified key.

Parameters
key: String

The key to check for.

Returns
Boolean

true if the SavedState contains a null reference for the key, false otherwise.

size

inline fun size(): Int

Returns the number of key-value pairs in the SavedState.

Returns
Int

The size of the SavedState.

toMap

fun toMap(): Map<StringAny?>

Returns a new Map containing all key-value pairs from the SavedState.

The returned Map does not preserve the entry iteration order of the SavedState.

IMPORTANT: All values will be copied by reference, and values within the SavedState that are also a SavedState will NOT be converted to a Map.

Returns
Map<StringAny?>

A Map containing all key-value pairs from the SavedState.