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 _map328 = iprot.readMapBegin();
            this.parts = Map<int, List<NewEdge>>();
            for (int _i329 = 0; _i329 < _map328.length; ++_i329) {
              int _key330;
              List<NewEdge> _val331;
              _key330 = iprot.readI32();
              {
                TList _list332 = iprot.readListBegin();
                _val331 = <NewEdge>[];
                for (int _i333 = 0; _i333 < _list332.length; ++_i333) {
                  NewEdge _elem334;
                  _elem334 = new NewEdge();
                  _elem334.read(iprot);
                  _val331.add(_elem334);
                }
                iprot.readListEnd();
              }
              this.parts?[_key330] = _val331;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case PROP_NAMES:
        if (field.type == TType.LIST) {
          {
            TList _list335 = iprot.readListBegin();
            this.prop_names = <Int8List>[];
            for (int _i336 = 0; _i336 < _list335.length; ++_i336) {
              Int8List _elem337;
              _elem337 = iprot.readBinary();
              this.prop_names?.add(_elem337);
            }
            iprot.readListEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case IF_NOT_EXISTS:
        if (field.type == TType.BOOL) {
          this.if_not_exists = iprot.readBool();
          this.__isset_if_not_exists = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case TERM:
        if (field.type == TType.I64) {
          this.term = iprot.readI64();
          this.__isset_term = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case EDGE_VERSION:
        if (field.type == TType.I64) {
          this.edge_version = iprot.readI64();
          this.__isset_edge_version = 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();
}