CharSequenceArraySerializer


public final class CharSequenceArraySerializer 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.CharSequenceArraySerializer

@Serializable
class MyModel(
    @Serializable(with = CharSequenceArraySerializer::class)
    val charSequenceArray: Array<CharSequence>
)

Summary

Public constructors

Public methods

@NonNull CharSequence[]
@NonNull SerialDescriptor
void
serialize(@NonNull Encoder encoder, @NonNull CharSequence[] value)

Public constructors

CharSequenceArraySerializer

Added in 1.3.0-alpha06
public CharSequenceArraySerializer()

Public methods

deserialize

Added in 1.3.0-alpha06
public @NonNull CharSequence[] deserialize(@NonNull Decoder decoder)

getDescriptor

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

serialize

Added in 1.3.0-alpha06
public void serialize(@NonNull Encoder encoder, @NonNull CharSequence[] value)