expects<T> method
Casts this object to type T
if possible, otherwise throws a DogSerializerException.
Implementation
T expects<T>(dynamic input, DogEngine engine, [String? message]) {
if (input is T) return input;
throw DogSerializerException(
message: message ?? "Expected type $T but got $runtimeType", converter: this);
}