decode method Null safety

XdrSorobanAuthorizedFunction decode(
  1. XdrDataInputStream stream
)

Implementation

static XdrSorobanAuthorizedFunction decode(XdrDataInputStream stream) {
  XdrSorobanAuthorizedFunction decoded = XdrSorobanAuthorizedFunction(
      XdrSorobanAuthorizedFunctionType.decode(stream));
  switch (decoded.type) {
    case XdrSorobanAuthorizedFunctionType
        .SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
      decoded.contractFn =
          XdrSorobanAuthorizedContractFunction.decode(stream);
      break;
    case XdrSorobanAuthorizedFunctionType
        .SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
      decoded.createContractHostFn = XdrCreateContractArgs.decode(stream);
      break;
  }
  return decoded;
}