read method
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 _map230 = iprot.readMapBegin();
this.parts = <int, ScanCursor>{};
for (int _i231 = 0; _i231 < _map230.length; ++_i231) {
int _key232;
ScanCursor _val233;
_key232 = iprot.readI32();
_val233 = new ScanCursor();
_val233.read(iprot);
this.parts?[_key232] = _val233;
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case RETURN_COLUMNS:
if (field.type == TType.LIST) {
{
TList _list234 = iprot.readListBegin();
this.return_columns = <EdgeProp>[];
for (int _i235 = 0; _i235 < _list234.length; ++_i235) {
EdgeProp _elem236;
_elem236 = new EdgeProp();
_elem236.read(iprot);
this.return_columns?.add(_elem236);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LIMIT:
if (field.type == TType.I64) {
this.limit = iprot.readI64();
this.__isset_limit = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case START_TIME:
if (field.type == TType.I64) {
this.start_time = iprot.readI64();
this.__isset_start_time = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case END_TIME:
if (field.type == TType.I64) {
this.end_time = iprot.readI64();
this.__isset_end_time = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case FILTER:
if (field.type == TType.STRING) {
this.filter = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ONLY_LATEST_VERSION:
if (field.type == TType.BOOL) {
this.only_latest_version = iprot.readBool();
this.__isset_only_latest_version = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ENABLE_READ_FROM_FOLLOWER:
if (field.type == TType.BOOL) {
this.enable_read_from_follower = iprot.readBool();
this.__isset_enable_read_from_follower = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case COMMON:
if (field.type == TType.STRUCT) {
this.common = new RequestCommon();
this.common?.read(iprot);
} 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();
}