Bundler
Implements encoding and decoding classes to/from androidx.core.bundle.Bundle.
Usage:
@Serializable
class Data(val property1: String)
@Serializable
class DataHolder(val data: Data, val property2: String)
val bundle = Bundler.encodeToBundle(DataHolder(Data("value1"), "value2"))
val dataHolder = Bundler.decodeFromBundle<DataHolder>(bundle)
Content copied to clipboard
Parameters
serializersModule
A SerializersModule which should contain registered serializers for kotlinx.serialization.Contextual and kotlinx.serialization.Polymorphic serialization, if you have any.
Inheritors
Functions
Link copied to clipboard
@ExperimentalSerializationApi
Decodes a value from the given bundle using the provided deserializer of type T.
Link copied to clipboard
@ExperimentalSerializationApi
Encodes the given value to a Bundle using the provided serializer of type T.