OptionalVariable.Serializer

class OptionalVariable.Serializer<T : Any?> : KSerializer


The KSerializer implementation for OptionalVariable.

Note that this serializer only supports serialize, and deserialize unconditionally throws an exception.

Summary

Public constructors

<T : Any?> Serializer(elementSerializer: KSerializer<T>)

Public functions

open OptionalVariable<T>
deserialize(decoder: Decoder)

Unconditionally throws UnsupportedOperationException.

open Unit
serialize(encoder: Encoder, value: OptionalVariable<T>)

Serializes the given OptionalVariable to the given encoder.

Public properties

open SerialDescriptor

Public constructors

Serializer

<T : Any?> Serializer(elementSerializer: KSerializer<T>)
Parameters
elementSerializer: KSerializer<T>

The KSerializer to use to serialize the encapsulated value.

Public functions

deserialize

open fun deserialize(decoder: Decoder): OptionalVariable<T>

Unconditionally throws UnsupportedOperationException.

serialize

open fun serialize(encoder: Encoder, value: OptionalVariable<T>): Unit

Serializes the given OptionalVariable to the given encoder.

This method does nothing if the given OptionalVariable is Undefined; otherwise, it serializes the encapsulated value in the given Value using the serializer given to this object's constructor.

Public properties

descriptor

open val descriptorSerialDescriptor