write method
Writes the objects out to the oprot
protocol.
Implementation
write(TProtocol oprot) {
validate();
oprot.writeStructBegin(_STRUCT_DESC);
oprot.writeFieldBegin(_PART_ID_FIELD_DESC);
oprot.writeI32(this.part_id);
oprot.writeFieldEnd();
if (isSetLeader()) {
if (this.leader != null) {
oprot.writeFieldBegin(_LEADER_FIELD_DESC);
this.leader?.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.peers != null) {
oprot.writeFieldBegin(_PEERS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.peers?.length));
for (var elem122 in this.peers ?? []) {
elem122.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (this.losts != null) {
oprot.writeFieldBegin(_LOSTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.losts?.length));
for (var elem123 in this.losts ?? []) {
elem123.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}