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 NVAL:
if (field.type == TType.I32) {
this.nVal = iprot.readI32();
this.__isset_nVal = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case BVAL:
if (field.type == TType.BOOL) {
this.bVal = iprot.readBool();
this.__isset_bVal = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case IVAL:
if (field.type == TType.I64) {
this.iVal = iprot.readI64();
this.__isset_iVal = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case FVAL:
if (field.type == TType.DOUBLE) {
this.fVal = iprot.readDouble();
this.__isset_fVal = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case SVAL:
if (field.type == TType.STRING) {
this.sVal = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case DVAL:
if (field.type == TType.STRUCT) {
this.dVal = new Date();
this.dVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case TVAL:
if (field.type == TType.STRUCT) {
this.tVal = new Time();
this.tVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case DTVAL:
if (field.type == TType.STRUCT) {
this.dtVal = new DateTime();
this.dtVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case VVAL:
if (field.type == TType.STRUCT) {
this.vVal = new Vertex();
this.vVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case EVAL:
if (field.type == TType.STRUCT) {
this.eVal = new Edge();
this.eVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case PVAL:
if (field.type == TType.STRUCT) {
this.pVal = new Path();
this.pVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LVAL:
if (field.type == TType.STRUCT) {
this.lVal = new NList();
this.lVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case MVAL:
if (field.type == TType.STRUCT) {
this.mVal = new NMap();
this.mVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case UVAL:
if (field.type == TType.STRUCT) {
this.uVal = new NSet();
this.uVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case GVAL:
if (field.type == TType.STRUCT) {
this.gVal = new DataSet();
this.gVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case GGVAL:
if (field.type == TType.STRUCT) {
this.ggVal = new Geography();
this.ggVal?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case DUVAL:
if (field.type == TType.STRUCT) {
this.duVal = new ng.Duration();
this.duVal?.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();
}