as<T extends CborObject> method

T as<T extends CborObject>([
  1. String? name
])

Implementation

T as<T extends CborObject>([String? name]) {
  try {
    return this as T;
  } catch (_) {
    throw ADAPluginException(
      "Failed to cast CBOR object${name != null ? ' for "$name"' : ''} as $T",
      details: {'expected': '$T', 'type': runtimeType.toString()},
    );
  }
}