MutableStateFlowSerializer


public final class MutableStateFlowSerializer<T extends Object>


A KSerializer for MutableStateFlow.

This class wraps a KSerializer for the inner value type T, enabling serialization and deserialization of MutableStateFlow instances. The inner value serialization is delegated to the provided valueSerializer.

Parameters
<T extends Object>

The type of the value stored in the MutableStateFlow.

Summary

Public constructors

Public constructors

MutableStateFlowSerializer

public <T extends Object> MutableStateFlowSerializer(
    @NonNull <Error class: unknown class><@NonNull T> valueSerializer
)
Parameters
<T extends Object>

The type of the value stored in the MutableStateFlow.

@NonNull <Error class: unknown class><@NonNull T> valueSerializer

The KSerializer used to serialize and deserialize the inner value.

Public methods

serialize

public void serialize(
    @NonNull <Error class: unknown class> encoder,
    @NonNull MutableStateFlow<@NonNull T> value
)