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 CODE:
        if (field.type == TType.I32) {
          this.code = iprot.readI32();
          this.__isset_code = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case INFO:
        if (field.type == TType.LIST) {
          {
            TList _list298 = iprot.readListBegin();
            this.info = <t_nebula.CheckpointInfo>[];
            for (int _i299 = 0; _i299 < _list298.length; ++_i299) {
              t_nebula.CheckpointInfo _elem300;
              _elem300 = new t_nebula.CheckpointInfo();
              _elem300.read(iprot);
              this.info?.add(_elem300);
            }
            iprot.readListEnd();
          }
        } 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();
}