read method

void read(
  1. TProtocol iprot
)
override

Reads the TObject from the given input protocol.

Implementation

read(TProtocol iprot) {
  TField field;
  iprot.readStructBegin();
  while (true) {
    field = iprot.readFieldBegin();
    if (field.type == TType.STOP) {
      break;
    }
    switch (field.id) {
      case SPACE_BACKUPS:
        if (field.type == TType.MAP) {
          {
            TMap _map274 = iprot.readMapBegin();
            this.space_backups = new Map<int, SpaceBackupInfo>();
            for (int _i275 = 0; _i275 < _map274.length; ++_i275) {
              int _key276;
              SpaceBackupInfo _val277;
              _key276 = iprot.readI32();
              _val277 = new SpaceBackupInfo();
              _val277.read(iprot);
              this.space_backups?[_key276] = _val277;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case META_FILES:
        if (field.type == TType.LIST) {
          {
            TList _list278 = iprot.readListBegin();
            this.meta_files = <Int8List>[];
            for (int _i279 = 0; _i279 < _list278.length; ++_i279) {
              Int8List _elem280;
              _elem280 = iprot.readBinary();
              this.meta_files?.add(_elem280);
            }
            iprot.readListEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case BACKUP_NAME:
        if (field.type == TType.STRING) {
          this.backup_name = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case FULL:
        if (field.type == TType.BOOL) {
          this.full = iprot.readBool();
          this.__isset_full = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case ALL_SPACES:
        if (field.type == TType.BOOL) {
          this.all_spaces = iprot.readBool();
          this.__isset_all_spaces = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CREATE_TIME:
        if (field.type == TType.I64) {
          this.create_time = iprot.readI64();
          this.__isset_create_time = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case BASE_BACKUP_NAME:
        if (field.type == TType.STRING) {
          this.base_backup_name = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case STORAGE_HOSTS:
        if (field.type == TType.LIST) {
          {
            TList _list281 = iprot.readListBegin();
            this.storage_hosts = <t_nebula.HostAddr>[];
            for (int _i282 = 0; _i282 < _list281.length; ++_i282) {
              t_nebula.HostAddr _elem283;
              _elem283 = new t_nebula.HostAddr();
              _elem283.read(iprot);
              this.storage_hosts?.add(_elem283);
            }
            iprot.readListEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CLUSTER_ID:
        if (field.type == TType.I64) {
          this.cluster_id = iprot.readI64();
          this.__isset_cluster_id = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      default:
        TProtocolUtil.skip(iprot, field.type);
        break;
    }
    iprot.readFieldEnd();
  }
  iprot.readStructEnd();

  // check for required fields of primitive type, which can't be checked in the validate method
  validate();
}