y
05/30/2023, 2:35 AMandylamax
05/30/2023, 3:48 AM@Transient
just make sure that, their are optional fields during constructing the classCLOVIS
05/30/2023, 7:50 AMJohann Pardanaud
05/30/2023, 9:19 AM@Transient
annotation too limited.
The costly intermediate values, in this case, would be surrogate classes right?
Fortunately, you can write a custom serializer without surrogates:
*<https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#hand-written-composite-serializer
|Hand-written composite serializer>*
There are some cases where a surrogate solution does not fit. Perhaps we want to avoid the performance implications of additional allocation, or we want a configurable/dynamic set of properties for the resulting serial representation. In these cases we need to manually write a class serializer which mimics the behaviour of a generated serializer.
Arjan van Wieringen
05/30/2023, 9:58 AMy
05/30/2023, 10:08 AMArjan van Wieringen
05/30/2023, 10:11 AMy
05/30/2023, 10:13 AMCLOVIS
05/30/2023, 11:30 AMy
05/30/2023, 11:53 AMSequence
over an iterator... all kinds of things that are probably meaningless premature optimization scaresArjan van Wieringen
05/30/2023, 12:04 PMArjan van Wieringen
05/30/2023, 12:05 PMCLOVIS
05/30/2023, 12:07 PM