ParcelableListSerializer


public final class ParcelableListSerializer implements KSerializer


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

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

@Serializable
class MyModel(
    @Serializable(with = ParcelableListSerializer::class)
    val parcelableList: List<android.os.Parcelable>
)

Summary

Public constructors

Public constructors

ParcelableListSerializer

Added in 1.3.0-alpha06
public ParcelableListSerializer()

Public methods

deserialize

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

getDescriptor

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

serialize

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