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

commonMain.dev.gitlive.firebase.internal.EncodeDecodeSettings.kt Maven / Gradle / Ivy

Go to download

The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the Firebase Android SDK Kotlin Extensions but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting iOS, Android or JS.

There is a newer version: 2.1.0
Show newest version
package dev.gitlive.firebase.internal

import dev.gitlive.firebase.DecodeSettings
import dev.gitlive.firebase.EncodeDecodeSettingsBuilder
import dev.gitlive.firebase.EncodeSettings
import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerializersModule

@PublishedApi
internal data class EncodeSettingsImpl internal constructor(
    override val encodeDefaults: Boolean,
    override val serializersModule: SerializersModule,
) : EncodeSettings {

    @PublishedApi
    internal class Builder : EncodeSettings.Builder {
        override var encodeDefaults: Boolean = true
        override var serializersModule: SerializersModule = EmptySerializersModule()
    }
}

@PublishedApi
internal class DecodeSettingsImpl internal constructor(
    override val serializersModule: SerializersModule = EmptySerializersModule(),
) : DecodeSettings {

    @PublishedApi
    internal class Builder : DecodeSettings.Builder {
        override var serializersModule: SerializersModule = EmptySerializersModule()
    }
}

@PublishedApi
internal class EncodeDecodeSettingsBuilderImpl : EncodeDecodeSettingsBuilder {

    override var encodeDefaults: Boolean = true
    override var serializersModule: SerializersModule = EmptySerializersModule()
}

@PublishedApi
internal fun EncodeSettings.Builder.buildEncodeSettings(): EncodeSettings = EncodeSettingsImpl(encodeDefaults, serializersModule)

@PublishedApi
internal fun DecodeSettings.Builder.buildDecodeSettings(): DecodeSettings = DecodeSettingsImpl(serializersModule)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy