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 EDGE_TYPES:
if (field.type == TType.LIST) {
{
TList _list18 = iprot.readListBegin();
this.edge_types = <int>[];
for (int _i19 = 0; _i19 < _list18.length; ++_i19) {
int _elem20;
_elem20 = iprot.readI32();
this.edge_types?.add(_elem20);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EDGE_DIRECTION:
if (field.type == TType.I32) {
this.edge_direction = iprot.readI32();
this.__isset_edge_direction = true;
} 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 STAT_PROPS:
if (field.type == TType.LIST) {
{
TList _list21 = iprot.readListBegin();
this.stat_props = <StatProp>[];
for (int _i22 = 0; _i22 < _list21.length; ++_i22) {
StatProp _elem23;
_elem23 = new StatProp();
_elem23.read(iprot);
this.stat_props?.add(_elem23);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case VERTEX_PROPS:
if (field.type == TType.LIST) {
{
TList _list24 = iprot.readListBegin();
this.vertex_props = <VertexProp>[];
for (int _i25 = 0; _i25 < _list24.length; ++_i25) {
VertexProp _elem26;
_elem26 = new VertexProp();
_elem26.read(iprot);
this.vertex_props?.add(_elem26);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EDGE_PROPS:
if (field.type == TType.LIST) {
{
TList _list27 = iprot.readListBegin();
this.edge_props = <EdgeProp>[];
for (int _i28 = 0; _i28 < _list27.length; ++_i28) {
EdgeProp _elem29;
_elem29 = new EdgeProp();
_elem29.read(iprot);
this.edge_props?.add(_elem29);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EXPRESSIONS:
if (field.type == TType.LIST) {
{
TList _list30 = iprot.readListBegin();
this.expressions = <Expr>[];
for (int _i31 = 0; _i31 < _list30.length; ++_i31) {
Expr _elem32;
_elem32 = new Expr();
_elem32.read(iprot);
this.expressions?.add(_elem32);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case ORDER_BY:
if (field.type == TType.LIST) {
{
TList _list33 = iprot.readListBegin();
this.order_by = <OrderBy>[];
for (int _i34 = 0; _i34 < _list33.length; ++_i34) {
OrderBy _elem35;
_elem35 = new OrderBy();
_elem35.read(iprot);
this.order_by?.add(_elem35);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case RANDOM:
if (field.type == TType.BOOL) {
this.random = iprot.readBool();
this.__isset_random = true;
} 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 TAG_FILTER:
if (field.type == TType.STRING) {
this.tag_filter = iprot.readBinary();
} 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();
}