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 elem278 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem278);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem278]?.length));
          for (var elem279 in this.parts?[elem278] ?? <t_nebula.KeyValue>[]) {
            elem279.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}