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 SRC:
        if (field.type == TType.STRUCT) {
          this.src = new Value();
          this.src?.read(iprot);
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case DST:
        if (field.type == TType.STRUCT) {
          this.dst = new Value();
          this.dst?.read(iprot);
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case TYPE:
        if (field.type == TType.I32) {
          this.type = iprot.readI32();
          this.__isset_type = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case NAME:
        if (field.type == TType.STRING) {
          this.name = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case RANKING:
        if (field.type == TType.I64) {
          this.ranking = iprot.readI64();
          this.__isset_ranking = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case PROPS:
        if (field.type == TType.MAP) {
          {
            TMap _map48 = iprot.readMapBegin();
            this.props = new Map<Int8List, Value>();
            for (int _i49 = 0; _i49 < _map48.length; ++_i49) {
              Int8List _key50;
              Value _val51;
              _key50 = iprot.readBinary();
              _val51 = new Value();
              _val51.read(iprot);
              this.props?[_key50] = _val51;
            }
            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();
}