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_ID:
        if (field.type == TType.I32) {
          this.space_id = iprot.readI32();
          this.__isset_space_id = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case PARTS:
        if (field.type == TType.MAP) {
          {
            TMap _map270 = iprot.readMapBegin();
            this.parts = <int, List<t_nebula.KeyValue>>{};
            for (int _i271 = 0; _i271 < _map270.length; ++_i271) {
              int _key272;
              List<t_nebula.KeyValue> _val273;
              _key272 = iprot.readI32();
              {
                TList _list274 = iprot.readListBegin();
                _val273 = <t_nebula.KeyValue>[];
                for (int _i275 = 0; _i275 < _list274.length; ++_i275) {
                  t_nebula.KeyValue _elem276;
                  _elem276 = new t_nebula.KeyValue();
                  _elem276.read(iprot);
                  _val273.add(_elem276);
                }
                iprot.readListEnd();
              }
              this.parts?[_key272] = _val273;
            }
            iprot.readMapEnd();
          }
        } 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();
}