ConverterHelperExtensions extension

Extension methods for DogConverter to simplify common deserialization tasks.

on

Methods

expects<T>(dynamic input, DogEngine engine, [String? message]) → T

Available on DogConverter, provided by the ConverterHelperExtensions extension

Casts this object to type T if possible, otherwise throws a DogSerializerException.
expectsOr<T>(dynamic input, T defaultValue, DogEngine engine) → T

Available on DogConverter, provided by the ConverterHelperExtensions extension

Casts this object to type T if possible, otherwise returns defaultValue.
readAs<T>(dynamic value, DogEngine engine, [T? defaultValue]) → T

Available on DogConverter, provided by the ConverterHelperExtensions extension

Reads a value of type T from value.
readAsMap(dynamic input, DogEngine engine) DogNativeMapReader

Available on DogConverter, provided by the ConverterHelperExtensions extension

Converts this object to a DogNativeMapReader if it is a Map<String, dynamic>, otherwise throws a DogSerializerException.