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

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

Cmn
android
inline Unit
putBinder(key: String, value: IBinder)

Stores an IBinder value associated with the specified key in the IBinder.

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)

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

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

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

Cmn
android
inline Unit

Stores a char sequence value associated with the specified key in the SavedState.

Cmn
android
inline Unit

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

Cmn
android
inline Unit

Stores a list of elements of CharSequence 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

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, value: IntArray)

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

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

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

Cmn
android
inline Unit
<T : Serializable> putJavaSerializable(key: String, value: T)

Stores an Serializable value associated with the specified key in the Serializable.

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, value: 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> putParcelableArray(key: String, value: Array<T>)

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

android
inline Unit
<T : Parcelable> putParcelableList(key: String, value: 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
putSize(key: String, value: Size)

Stores an Size value associated with the specified key in the Size.

android
inline Unit
putSizeF(key: String, value: SizeF)

Stores an SizeF value associated with the specified key in the SizeF.

android
inline Unit

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

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, value: Array<String>)

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

Cmn
android
inline Unit
putStringList(key: String, value: 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(from: SavedState): Unit

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

Parameters
from: SavedState

The SavedState containing the key-value pairs to add.

putBinder

inline fun putBinder(key: String, value: IBinder): Unit

Stores an IBinder value associated with the specified key in the IBinder.

Parameters
key: String

The key to associate the value with.

value: IBinder

The IBinder value to store.

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, value: 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.

value: BooleanArray

The array of elements to store.

putChar

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

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

Parameters
key: String

The key to associate the value with.

value: Char

The char value to store.

putCharArray

inline fun putCharArray(key: String, value: 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.

value: CharArray

The array of elements to store.

putCharSequence

inline fun putCharSequence(key: String, value: CharSequence): Unit

Stores a char sequence value associated with the specified key in the SavedState.

Parameters
key: String

The key to associate the value with.

value: CharSequence

The char sequence value to store.

putCharSequenceArray

inline fun putCharSequenceArray(key: String, value: Array<CharSequence>): Unit

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

Parameters
key: String

The key to associate the value with.

value: Array<CharSequence>

The array of elements to store.

putCharSequenceList

inline fun putCharSequenceList(key: String, value: List<CharSequence>): Unit

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

Parameters
key: String

The key to associate the value with.

value: List<CharSequence>

The list 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, value: 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.

value: 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, value: 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.

value: 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, value: 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.

value: IntArray

The array of elements to store.

putIntList

inline fun putIntList(key: String, value: 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.

value: List<Int>

The list of elements to store.

putJavaSerializable

inline fun <T : Serializable> putJavaSerializable(key: String, value: T): Unit

Stores an Serializable value associated with the specified key in the Serializable.

Parameters
key: String

The key to associate the value with.

value: T

The Serializable value 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, value: 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.

value: 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.

putParcelableArray

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

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

Parameters
key: String

The key to associate the value with.

value: Array<T>

The Array of elements to store.

putParcelableList

inline fun <T : Parcelable> putParcelableList(key: String, value: 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.

value: 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

putSize

inline fun putSize(key: String, value: Size): Unit

Stores an Size value associated with the specified key in the Size.

Parameters
key: String

The key to associate the value with.

value: Size

The Size value to store.

putSizeF

inline fun putSizeF(key: String, value: SizeF): Unit

Stores an SizeF value associated with the specified key in the SizeF.

Parameters
key: String

The key to associate the value with.

value: SizeF

The SizeF value to store.

putSparseParcelableArray

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

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

Parameters
key: String

The key to associate the value with.

value: SparseArray<T>

The SparseArray of elements 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, value: 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.

value: Array<String>

The array of elements to store.

putStringList

inline fun putStringList(key: String, value: 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.

value: 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.