SavedStateConfiguration.Builder


public final class SavedStateConfiguration.Builder


Builder of the SavedStateConfiguration instance provided by SavedStateConfig { ... } factory function.

Summary

Public methods

final int

Defines which classes and objects should have class discriminator added to the output.

final boolean

Specifies whether default values of Kotlin properties should be encoded.

final @NonNull SerializersModule

Module with contextual and polymorphic serializers to be used in the resulting SavedStateConfiguration instance.

final void

Defines which classes and objects should have class discriminator added to the output.

final void
setEncodeDefaults(boolean value)

Specifies whether default values of Kotlin properties should be encoded.

final void

Module with contextual and polymorphic serializers to be used in the resulting SavedStateConfiguration instance.

Public methods

getClassDiscriminatorMode

Added in 1.3.0
public final int getClassDiscriminatorMode()

Defines which classes and objects should have class discriminator added to the output. ClassDiscriminatorMode.POLYMORPHIC by default.

getEncodeDefaults

Added in 1.3.0
public final boolean getEncodeDefaults()

Specifies whether default values of Kotlin properties should be encoded. false by default. This option does not affect decoding.

getSerializersModule

Added in 1.3.0
public final @NonNull SerializersModule getSerializersModule()

Module with contextual and polymorphic serializers to be used in the resulting SavedStateConfiguration instance.

Note that this SerializersModule will be combined with an internal SerializersModule in the resulting SavedStateConfiguration to support built-in types.

setClassDiscriminatorMode

Added in 1.3.0
public final void setClassDiscriminatorMode(int value)

Defines which classes and objects should have class discriminator added to the output. ClassDiscriminatorMode.POLYMORPHIC by default.

setEncodeDefaults

Added in 1.3.0
public final void setEncodeDefaults(boolean value)

Specifies whether default values of Kotlin properties should be encoded. false by default. This option does not affect decoding.

setSerializersModule

Added in 1.3.0
public final void setSerializersModule(@NonNull SerializersModule value)

Module with contextual and polymorphic serializers to be used in the resulting SavedStateConfiguration instance.

Note that this SerializersModule will be combined with an internal SerializersModule in the resulting SavedStateConfiguration to support built-in types.