BoomerangFormat
open class BoomerangFormat(val serializersModule: SerializersModule = EmptySerializersModule())(source)
A small adapter that bridges Kotlinx Serialization with Boomerang.
BoomerangFormat provides serialize/deserialize helpers that convert between arbitrary @Serializable objects and the Boomerang key–value container used throughout the Boomerang ecosystem (core, fragment, compose, etc.).
Configuration
You can pass a custom serializersModule to register polymorphic serializers, custom serializers, and context-aware serialization.
A singleton, lazily configurable instance is exposed via companion object. You can globally replace it using BoomerangConfig.format.
Thread-safety
Instances are immutable and can be safely shared across threads.
Typical usage
@Serializable data class User(val id: String)
// Serialize to a Boomerang
val b: Boomerang = BoomerangFormat.serialize(User("42"))
// Deserialize back
val u: User = BoomerangFormat.deserialize(b)
// Or configure globally for extension functions in this module
BoomerangConfig.format = BoomerangFormat {
serializersModule = SerializersModule { /* polymorphic {} etc. */}
}Content copied to clipboard