MapperDeserializationStrategy

open class MapperDeserializationStrategy<I, O>(base: DeserializationStrategy<I>, deserialize: (Decoder, I) -> O) : DeserializationStrategy<O> (source)

Use this serializer when you have deserializable type I and want to map it to some O in process of deserialization

Parameters

base

Serializer for I

deserialize

Will be used in deserialize method to convert deserialized by base to O

Constructors

Link copied to clipboard
constructor(base: DeserializationStrategy<I>, deserialize: (I) -> O)
constructor(base: DeserializationStrategy<I>, deserialize: (Decoder, I) -> O)

Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor

Functions

Link copied to clipboard
open override fun deserialize(decoder: Decoder): O
Link copied to clipboard
inline fun <I : Any, O> DeserializationStrategy<I>.mapDeserialization(noinline deserialize: (I) -> O): MapperDeserializationStrategy<I, O>

Will create MapperDeserializationStrategy to allow you to map I to O using deserialize lambda during deserialization process