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 HOST:
        if (field.type == TType.STRUCT) {
          this.host = new t_nebula.HostAddr();
          this.host?.read(iprot);
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CHECKPOINTS:
        if (field.type == TType.LIST) {
          {
            TList _list266 = iprot.readListBegin();
            this.checkpoints = <t_nebula.CheckpointInfo>[];
            for (int _i267 = 0; _i267 < _list266.length; ++_i267) {
              t_nebula.CheckpointInfo _elem268;
              _elem268 = new t_nebula.CheckpointInfo();
              _elem268.read(iprot);
              this.checkpoints?.add(_elem268);
            }
            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();
}