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 CODE:
if (field.type == TType.I32) {
this.code = iprot.readI32();
this.__isset_code = true;
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case LEADER:
if (field.type == TType.STRUCT) {
this.leader = new t_nebula.HostAddr();
this.leader?.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case INDEXES:
if (field.type == TType.MAP) {
{
TMap _map332 = iprot.readMapBegin();
this.indexes = new Map<Int8List, FTIndex>();
for (int _i333 = 0; _i333 < _map332.length; ++_i333) {
Int8List _key334;
FTIndex _val335;
_key334 = iprot.readBinary();
_val335 = new FTIndex();
_val335.read(iprot);
this.indexes?[_key334] = _val335;
}
iprot.readMapEnd();
}
} 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();
}