-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
1,980 additions
and
1,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
firebase-common/src/commonMain/kotlin/dev/gitlive/firebase/EncodeDecodeSettings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package dev.gitlive.firebase | ||
|
||
import kotlinx.serialization.modules.EmptySerializersModule | ||
import kotlinx.serialization.modules.SerializersModule | ||
|
||
/** | ||
* Settings used to configure encoding/decoding | ||
*/ | ||
sealed class EncodeDecodeSettings { | ||
|
||
/** | ||
* The [SerializersModule] to use for serialization. This allows for polymorphic serialization on runtime | ||
*/ | ||
abstract val serializersModule: SerializersModule | ||
} | ||
|
||
/** | ||
* [EncodeDecodeSettings] used when encoding an object | ||
* @property shouldEncodeElementDefault if `true` this will explicitly encode elements even if they are their default value | ||
* @param serializersModule the [SerializersModule] to use for serialization. This allows for polymorphic serialization on runtime | ||
*/ | ||
data class EncodeSettings( | ||
val shouldEncodeElementDefault: Boolean = true, | ||
override val serializersModule: SerializersModule = EmptySerializersModule(), | ||
) : EncodeDecodeSettings() | ||
|
||
/** | ||
* [EncodeDecodeSettings] used when decoding an object | ||
* @param serializersModule the [SerializersModule] to use for deserialization. This allows for polymorphic serialization on runtime | ||
*/ | ||
data class DecodeSettings( | ||
override val serializersModule: SerializersModule = EmptySerializersModule(), | ||
) : EncodeDecodeSettings() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.