CharSequenceListSerializer


public final class CharSequenceListSerializer implements KSerializer


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

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.CharSequenceListSerializer

@Serializable
class MyModel(
    @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
    @Serializable(with = CharSequenceListSerializer::class)
    val charSequenceList: List<CharSequence>
)

Summary

Public constructors

Public constructors

CharSequenceListSerializer

Added in 1.3.0-alpha06
public CharSequenceListSerializer()

Public methods

deserialize

Added in 1.3.0-alpha06
public @NonNull List<@NonNull CharSequencedeserialize(@NonNull Decoder decoder)

getDescriptor

Added in 1.3.0-alpha06
public @NonNull SerialDescriptor getDescriptor()

serialize

public void serialize(
    @NonNull Encoder encoder,
    @NonNull List<@NonNull CharSequence> value
)