Class KobbyKotlinDtoSerializationExtension
-
- All Implemented Interfaces:
public class KobbyKotlinDtoSerializationExtensionConfiguration of Kotlinx Serialization support for DTO classes.
Note that Kotlinx serialization and Jackson serialization are not supported simultaneously.
-
-
Field Summary
Fields Modifier and Type Field Description private Booleanenabledprivate StringclassDiscriminatorprivate BooleanignoreUnknownKeysprivate BooleanencodeDefaultsprivate BooleanprettyPrint
-
Constructor Summary
Constructors Constructor Description KobbyKotlinDtoSerializationExtension()
-
Method Summary
Modifier and Type Method Description final BooleangetEnabled()Is Kotlinx Serialization enabled. final UnitsetEnabled(Boolean enabled)Is Kotlinx Serialization enabled. final StringgetClassDiscriminator()Name of the class descriptor property for polymorphic serialization. final UnitsetClassDiscriminator(String classDiscriminator)Name of the class descriptor property for polymorphic serialization. final BooleangetIgnoreUnknownKeys()Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing SerializationException. final UnitsetIgnoreUnknownKeys(Boolean ignoreUnknownKeys)Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing SerializationException. final BooleangetEncodeDefaults()Specifies whether default values of Kotlin properties should be encoded to JSON. final UnitsetEncodeDefaults(Boolean encodeDefaults)Specifies whether default values of Kotlin properties should be encoded to JSON. final BooleangetPrettyPrint()Specifies whether resulting JSON should be pretty-printed. final UnitsetPrettyPrint(Boolean prettyPrint)Specifies whether resulting JSON should be pretty-printed. -
-
Method Detail
-
getEnabled
final Boolean getEnabled()
Is Kotlinx Serialization enabled. Note that Kotlinx serialization and Jackson serialization are not supported simultaneously.
By default, "true" if "org.jetbrains.kotlinx:kotlinx-serialization-json" artifact is in the project dependencies.
-
setEnabled
final Unit setEnabled(Boolean enabled)
Is Kotlinx Serialization enabled. Note that Kotlinx serialization and Jackson serialization are not supported simultaneously.
By default, "true" if "org.jetbrains.kotlinx:kotlinx-serialization-json" artifact is in the project dependencies.
-
getClassDiscriminator
final String getClassDiscriminator()
Name of the class descriptor property for polymorphic serialization.
Default: "__typename"
-
setClassDiscriminator
final Unit setClassDiscriminator(String classDiscriminator)
Name of the class descriptor property for polymorphic serialization.
Default: "__typename"
-
getIgnoreUnknownKeys
final Boolean getIgnoreUnknownKeys()
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing SerializationException.
Default: true
-
setIgnoreUnknownKeys
final Unit setIgnoreUnknownKeys(Boolean ignoreUnknownKeys)
Specifies whether encounters of unknown properties in the input JSON should be ignored instead of throwing SerializationException.
Default: true
-
getEncodeDefaults
final Boolean getEncodeDefaults()
Specifies whether default values of Kotlin properties should be encoded to JSON.
Default: false
-
setEncodeDefaults
final Unit setEncodeDefaults(Boolean encodeDefaults)
Specifies whether default values of Kotlin properties should be encoded to JSON.
Default: false
-
getPrettyPrint
final Boolean getPrettyPrint()
Specifies whether resulting JSON should be pretty-printed.
Default: false
-
setPrettyPrint
final Unit setPrettyPrint(Boolean prettyPrint)
Specifies whether resulting JSON should be pretty-printed.
Default: false
-
-
-
-