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 JOB_ID:
        if (field.type == TType.I32) {
          this.job_id = iprot.readI32();
          this.__isset_job_id = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case JOB_DESC:
        if (field.type == TType.LIST) {
          {
            TList _list44 = iprot.readListBegin();
            this.job_desc = <JobDesc>[];
            for (int _i45 = 0; _i45 < _list44.length; ++_i45) {
              JobDesc _elem46;
              _elem46 = new JobDesc();
              _elem46.read(iprot);
              this.job_desc?.add(_elem46);
            }
            iprot.readListEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case TASK_DESC:
        if (field.type == TType.LIST) {
          {
            TList _list47 = iprot.readListBegin();
            this.task_desc = <TaskDesc>[];
            for (int _i48 = 0; _i48 < _list47.length; ++_i48) {
              TaskDesc _elem49;
              _elem49 = new TaskDesc();
              _elem49.read(iprot);
              this.task_desc?.add(_elem49);
            }
            iprot.readListEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case RECOVERED_JOB_NUM:
        if (field.type == TType.I32) {
          this.recovered_job_num = iprot.readI32();
          this.__isset_recovered_job_num = 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();
}