SavedStateWriter



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

See also
write

Summary

Public functions

inline Unit

Removes all key-value pairs from the SavedState.

Cmn
android
inline Unit
putAll(values: SavedState)

Stores all key-value pairs from the provided SavedState into this SavedState.

Cmn
android
inline Unit
putBoolean(key: String, value: Boolean)

Stores a boolean value associated with the specified key in the SavedState.

Cmn
android
inline Unit

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Cmn
android
inline Unit
putChar(key: String, value: Char)
Cmn
android
inline Unit
putCharArray(key: String, values: CharArray)

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Cmn
android
inline Unit
putDouble(key: String, value: Double)

Stores a double value associated with the specified key in the SavedState.

Cmn
android
inline Unit

Stores an Array of elements of Double associated with the specified key in the SavedState.

Cmn
android
inline Unit
putFloat(key: String, value: Float)

Stores a float value associated with the specified key in the SavedState.

Cmn
android
inline Unit
putFloatArray(key: String, values: FloatArray)

Stores an Array of elements of Float associated with the specified key in the SavedState.

Cmn
android
inline Unit
putInt(key: String, value: Int)

Stores an int value associated with the specified key in the SavedState.

Cmn
android
inline Unit
putIntArray(key: String, values: IntArray)

Stores an Array of elements of Int associated with the specified key in the SavedState.

Cmn
android
inline Unit
putIntList(key: String, values: List<Int>)

Stores a list of elements of Int associated with the specified key in the SavedState.

Cmn
android
inline Unit
putLong(key: String, value: Long)

Stores an int value associated with the specified key in the SavedState.

Cmn
android
inline Unit
putLongArray(key: String, values: LongArray)

Stores an Array of elements of Long associated with the specified key in the SavedState.

Cmn
android
inline Unit

Stores a null reference associated with the specified key in the SavedState.

Cmn
android
inline Unit
<T : Parcelable> putParcelable(key: String, value: T)

Stores an Parcelable value associated with the specified key in the SavedState.

android
inline Unit
<T : Parcelable> putParcelableList(key: String, values: List<T>)

Stores a list of elements of Parcelable associated with the specified key in the SavedState.

android
inline Unit

Stores a SavedState object associated with the specified key in the SavedState.

Cmn
android
inline Unit
putString(key: String, value: String)

Stores a string value associated with the specified key in the SavedState.

Cmn
android
inline Unit
putStringArray(key: String, values: Array<String>)

Stores an Array of elements of String associated with the specified key in the SavedState.

Cmn
android
inline Unit
putStringList(key: String, values: List<String>)

Stores a list of elements of String associated with the specified key in the SavedState.

Cmn
android
inline Unit
remove(key: String)

Removes the value associated with the specified key from the SavedState.

Cmn
android

Public functions

clear

inline fun clear(): Unit

Removes all key-value pairs from the SavedState.

putAll

inline fun putAll(values: SavedState): Unit

Stores all key-value pairs from the provided SavedState into this SavedState.

Parameters
values: SavedState

The SavedState containing the key-value pairs to add.

putBoolean

inline fun putBoolean(key: String, value: Boolean): Unit

Stores a boolean value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Boolean

The boolean value to store.

putBooleanArray

inline fun putBooleanArray(key: String, values: BooleanArray): Unit

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: BooleanArray

The array of elements to store.

putChar

inline fun putChar(key: String, value: Char): Unit

putCharArray

inline fun putCharArray(key: String, values: CharArray): Unit

Stores an Array of elements of Boolean associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: CharArray

The array of elements to store.

putDouble

inline fun putDouble(key: String, value: Double): Unit

Stores a double value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Double

The double value to store.

putDoubleArray

inline fun putDoubleArray(key: String, values: DoubleArray): Unit

Stores an Array of elements of Double associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: DoubleArray

The array of elements to store.

putFloat

inline fun putFloat(key: String, value: Float): Unit

Stores a float value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Float

The float value to store.

putFloatArray

inline fun putFloatArray(key: String, values: FloatArray): Unit

Stores an Array of elements of Float associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: FloatArray

The array of elements to store.

putInt

inline fun putInt(key: String, value: Int): Unit

Stores an int value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Int

The int value to store.

putIntArray

inline fun putIntArray(key: String, values: IntArray): Unit

Stores an Array of elements of Int associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: IntArray

The array of elements to store.

putIntList

inline fun putIntList(key: String, values: List<Int>): Unit

Stores a list of elements of Int associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: List<Int>

The list of elements to store.

putLong

inline fun putLong(key: String, value: Long): Unit

Stores an int value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: Long

The Long value to store.

putLongArray

inline fun putLongArray(key: String, values: LongArray): Unit

Stores an Array of elements of Long associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: LongArray

The array of elements to store.

putNull

inline fun putNull(key: String): Unit

Stores a null reference associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the null reference.

putParcelable

inline fun <T : Parcelable> putParcelable(key: String, value: T): Unit

Stores an Parcelable value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: T

The Parcelable value to store.

putParcelableList

inline fun <T : Parcelable> putParcelableList(key: String, values: List<T>): Unit

Stores a list of elements of Parcelable associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: List<T>

The list of elements to store.

putSavedState

inline fun putSavedState(key: String, value: SavedState): Unit

Stores a SavedState object associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: SavedState

The SavedState object to store

putString

inline fun putString(key: String, value: String): Unit

Stores a string value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: String

The string value to store.

putStringArray

inline fun putStringArray(key: String, values: Array<String>): Unit

Stores an Array of elements of String associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: Array<String>

The array of elements to store.

putStringList

inline fun putStringList(key: String, values: List<String>): Unit

Stores a list of elements of String associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

values: List<String>

The list of elements to store.

remove

inline fun remove(key: String): Unit

Removes the value associated with the specified key from the SavedState.

Parameters
key: String

The key to remove.