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();
  if (this.parts != null) {
    oprot.writeFieldBegin(_PARTS_FIELD_DESC);
    {
      oprot
          .writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts?.length));
      for (var elem354 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem354);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem354]?.length));
          for (var elem355 in this.parts?[elem354] ?? <EdgeKey>[]) {
            elem355.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  if (this.txn_id != null) {
    oprot.writeFieldBegin(_TXN_ID_FIELD_DESC);
    oprot.writeBinary(this.txn_id);
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_TERM_FIELD_DESC);
  oprot.writeI64(this.term);
  oprot.writeFieldEnd();
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}