encodeElement

open fun encodeElement(descriptor: SerialDescriptor, index: Int): Boolean

Invoked before writing an element that is part of the structure to determine whether it should be encoded. Element information can be obtained from the descriptor by the given index.

Return

true if the value should be encoded, false otherwise