All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.copperleaf.ballast.debugger.versions.v3.ClientModelSerializerV3.kt Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package com.copperleaf.ballast.debugger.versions.v3

import com.copperleaf.ballast.debugger.versions.ClientModelSerializer
import kotlinx.serialization.json.Json

public class ClientModelSerializerV3 : ClientModelSerializer {
    private val debuggerEventJson: Json = Json {
        isLenient = true
    }

    override val supported: Boolean = true

    override fun mapIncoming(incoming: String): BallastDebuggerEventV3 {
        return debuggerEventJson
            .decodeFromString(BallastDebuggerEventV3.serializer(), incoming)
    }

    override fun mapOutgoing(outgoing: BallastDebuggerActionV3): String {
        return debuggerEventJson
            .encodeToString(BallastDebuggerActionV3.serializer(), outgoing)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy