write method

void write(
  1. TProtocol oprot
)
override

Writes the objects out to the oprot protocol.

Implementation

write(TProtocol oprot) {
  validate();

  oprot.writeStructBegin(_STRUCT_DESC);
  oprot.writeFieldBegin(_SPACE_ID_FIELD_DESC);
  oprot.writeI32(this.space_id);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_PART_ID_FIELD_DESC);
  oprot.writeI32(this.part_id);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_AS_LEARNER_FIELD_DESC);
  oprot.writeBool(this.as_learner);
  oprot.writeFieldEnd();
  if (this.peers != null) {
    oprot.writeFieldBegin(_PEERS_FIELD_DESC);
    {
      oprot.writeListBegin(new TList(TType.STRUCT, this.peers?.length));
      for (var elem293 in this.peers ?? []) {
        elem293.write(oprot);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}