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 _map70 = iprot.readMapBegin();
this.parts = new Map<int, List<t_nebula.Row>>();
for (int _i71 = 0; _i71 < _map70.length; ++_i71) {
int _key72;
List<t_nebula.Row> _val73;
_key72 = iprot.readI32();
{
TList _list74 = iprot.readListBegin();
_val73 = <t_nebula.Row>[];
for (int _i75 = 0; _i75 < _list74.length; ++_i75) {
t_nebula.Row _elem76;
_elem76 = new t_nebula.Row();
_elem76.read(iprot);
_val73.add(_elem76);
}
iprot.readListEnd();
}
this.parts?[_key72] = _val73;
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case VERTEX_PROPS:
if (field.type == TType.LIST) {
{
TList _list77 = iprot.readListBegin();
this.vertex_props = <VertexProp>[];
for (int _i78 = 0; _i78 < _list77.length; ++_i78) {
VertexProp _elem79;
_elem79 = new VertexProp();
_elem79.read(iprot);
this.vertex_props?.add(_elem79);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EDGE_PROPS:
if (field.type == TType.LIST) {
{
TList _list80 = iprot.readListBegin();
this.edge_props = <EdgeProp>[];
for (int _i81 = 0; _i81 < _list80.length; ++_i81) {
EdgeProp _elem82;
_elem82 = new EdgeProp();
_elem82.read(iprot);
this.edge_props?.add(_elem82);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EXPRESSIONS:
if (field.type == TType.LIST) {
{
TList _list83 = iprot.readListBegin();
this.expressions = <Expr>[];
for (int _i84 = 0; _i84 < _list83.length; ++_i84) {
Expr _elem85;
_elem85 = new Expr();
_elem85.read(iprot);
this.expressions?.add(_elem85);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case DEDUP:
if (field.type == TType.BOOL) {
this.dedup = iprot.readBool();
this.__isset_dedup = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ORDER_BY:
if (field.type == TType.LIST) {
{
TList _list86 = iprot.readListBegin();
this.order_by = <OrderBy>[];
for (int _i87 = 0; _i87 < _list86.length; ++_i87) {
OrderBy _elem88;
_elem88 = new OrderBy();
_elem88.read(iprot);
this.order_by?.add(_elem88);
}
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 FILTER:
if (field.type == TType.STRING) {
this.filter = 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
validate();
}