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 PART_ID:
if (field.type == TType.I32) {
this.part_id = iprot.readI32();
this.__isset_part_id = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case VERTEX_ID:
if (field.type == TType.STRUCT) {
this.vertex_id = new t_nebula.Value();
this.vertex_id?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case TAG_ID:
if (field.type == TType.I32) {
this.tag_id = iprot.readI32();
this.__isset_tag_id = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case UPDATED_PROPS:
if (field.type == TType.LIST) {
{
TList _list176 = iprot.readListBegin();
this.updated_props = <UpdatedProp>[];
for (int _i177 = 0; _i177 < _list176.length; ++_i177) {
UpdatedProp _elem178;
_elem178 = new UpdatedProp();
_elem178.read(iprot);
this.updated_props?.add(_elem178);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case INSERTABLE:
if (field.type == TType.BOOL) {
this.insertable = iprot.readBool();
this.__isset_insertable = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case RETURN_PROPS:
if (field.type == TType.LIST) {
{
TList _list179 = iprot.readListBegin();
this.return_props = <Int8List>[];
for (int _i180 = 0; _i180 < _list179.length; ++_i180) {
Int8List _elem181;
_elem181 = iprot.readBinary();
this.return_props?.add(_elem181);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case CONDITION:
if (field.type == TType.STRING) {
this.condition = iprot.readBinary();
} 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
if (!__isset_tag_id) {
throw new TProtocolError(
TProtocolErrorType.UNKNOWN,
"Required field 'tag_id' was not found in serialized data! Struct: " +
toString());
}
validate();
}