CallbackCustomizableDeserializationStrategy
open class CallbackCustomizableDeserializationStrategy<T>(val descriptor: SerialDescriptor, defaultDeserializeCallback: (decoder: Decoder, jsonElement: JsonElement?) -> T, fallbackDeserialization: (initialException: Throwable, decoder: Decoder, jsonElement: JsonElement?) -> T = { initialException, _, _ -> throw initialException }) : CustomizableDeserializationStrategy<T>
Inheritors
Properties
Link copied to clipboard
open override val customDeserializationStrategies: Set<CustomizableDeserializationStrategy.JsonDeserializerStrategy<T>>
Contains JsonDeserializerStrategy which will be used in deserialize method when standard RawUpdate serializer will be unable to create RawUpdate (and Update as well)
Link copied to clipboard
Functions
Link copied to clipboard
open override fun addUpdateDeserializationStrategy(deserializationStrategy: CustomizableDeserializationStrategy.JsonDeserializerStrategy<T>): Boolean
Adding deserializationStrategy into customDeserializationStrategies for using in case of unknown update
Link copied to clipboard
Trying to get JsonElement if decoder is JsonDecoder. Then it will use defaultDeserializeCallback to deserialize data. In case if defaultDeserializeCallback will throw exception it will firstly try to deserialize data by strategies from customDeserializationStrategies and, if no one will return presented data in Optional it will use fallbackDeserialization as last option to deserialize data
Link copied to clipboard
open override fun removeUpdateDeserializationStrategy(deserializationStrategy: CustomizableDeserializationStrategy.JsonDeserializerStrategy<T>): Boolean
Removing deserializationStrategy from customDeserializationStrategies