CharSequenceSerializer



A serializer for CharSequence. This serializer uses SavedState's API directly to save/load a CharSequence.

Note that this serializer should be used with SavedStateEncoder or SavedStateDecoder only. Using it with other Encoders/Decoders may throw IllegalArgumentException.

import androidx.savedstate.serialization.serializers.CharSequenceSerializer

@Serializable
data class MyModel(
    @Serializable(with = CharSequenceSerializer::class) val charSequence: CharSequence
)

Summary

Public constructors

android

Public functions

final T
deserialize(decoder: Decoder)
android
final Unit
serialize(encoder: Encoder, value: T)
android

Public properties

final SerialDescriptor
android

Public constructors

CharSequenceSerializer

<T : CharSequence> CharSequenceSerializer()

Public functions

deserialize

final fun deserialize(decoder: Decoder): T

serialize

final fun serialize(encoder: Encoder, value: T): Unit

Public properties

descriptor

final val descriptorSerialDescriptor