CallbackCustomizableDeserializationStrategy

open class CallbackCustomizableDeserializationStrategy<T>(val descriptor: <Error class: unknown class>, defaultDeserializeCallback: (<Error class: unknown class>, <Error class: unknown class>?) -> T, fallbackDeserialization: (initialException: Throwable, <Error class: unknown class>, <Error class: unknown class>?) -> T = { initialException, _, _ -> throw initialException }) : CustomizableDeserializationStrategy<T>

Inheritors

Constructors

constructor(descriptor: <Error class: unknown class>, defaultDeserializeCallback: (<Error class: unknown class>, <Error class: unknown class>?) -> T, fallbackDeserialization: (initialException: Throwable, <Error class: unknown class>, <Error class: unknown class>?) -> T = { initialException, _, _ -> throw initialException })

Properties

Link copied to clipboard

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
open val descriptor: <Error class: unknown class>

Functions

Link copied to clipboard
Link copied to clipboard
open fun deserialize(decoder: <Error class: unknown class>): T

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