# EitherSerializer

class EitherSerializer < T1 , T2 >(t1Serializer: KSerializer< T1 >, t2Serializer: KSerializer< T2 >) : KSerializer< Either < T1 , T2 >> (source)

## Constructors

EitherSerializer
Link copied to clipboard
constructor(t1Serializer: KSerializer< T1 >, t2Serializer: KSerializer< T2 >)

## Properties

descriptor
Link copied to clipboard
open override val descriptor : SerialDescriptor

## Functions

deserialize
Link copied to clipboard
open override fun deserialize (decoder: Decoder): Either < T1 , T2 >
mapDeserialization
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

mapFullSerialization
Link copied to clipboard
inline fun < I : Any , O > KSerializer< I >. mapFullSerialization (noinline serialize: ( O ) -> I , noinline deserialize: ( I ) -> O ): MapperSerializer < I , O >

Will create MapperSerializer to allow you to map O to I and vice verse using serialize/deserialize lambda during serialization/deserialization process

mapSerialization
Link copied to clipboard
inline fun < I : Any , O > SerializationStrategy< I >. mapSerialization (noinline serialize: ( O ) -> I ): MapperSerializationStrategy < I , O >

Will create MapperSerializationStrategy to allow you to map O to I using serialize lambda during serialization process

serialize
Link copied to clipboard
open override fun serialize (encoder: Encoder, value: Either < T1 , T2 >)