getIntValueAs<T extends CborObject?> method

T getIntValueAs<T extends CborObject?>(
  1. int key
)

Implementation

T getIntValueAs<T extends CborObject?>(int key) {
  final val = value[CborIntValue(key)];
  if (val == null && null is T) return null as T;
  if (null is T && val is CborNullValue) return null as T;
  if (val is! T) {
    throw ADAPluginException("Failed to cast CBOR object for $key as $T",
        details: {'expected': '$T', 'type': val.runtimeType});
  }
  return val;
}