decode method

  1. @override
RequestId decode(
  1. Object? value
)
override

Decodes a JSON-compatible wire value.

Implementation

@override
RequestId decode(Object? value) {
  if (value == null) {
    return const RequestIdNull();
  }
  try {
    return RequestIdNumber(decodeAcpInt64(value));
  } on Object {
    // Try the next structurally distinct member.
  }
  if (value is String) {
    return RequestIdStr(decodeAcpString(value));
  }
  throw const FormatException('Value does not match RequestId');
}