decode method Null safety

XdrContractIDType decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrContractIDType decode(XdrDataInputStream stream) {
  int value = stream.readInt();
  switch (value) {
    case 0:
      return CONTRACT_ID_FROM_SOURCE_ACCOUNT;
    case 1:
      return CONTRACT_ID_FROM_ED25519_PUBLIC_KEY;
    case 2:
      return CONTRACT_ID_FROM_ASSET;
    default:
      throw Exception("Unknown enum value: $value");
  }
}