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 elem123 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem123);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem123]?.length));
          for (var elem124 in this.parts?[elem123] ?? []) {
            elem124.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  if (this.prop_names != null) {
    oprot.writeFieldBegin(_PROP_NAMES_FIELD_DESC);
    {
      oprot.writeMapBegin(
          new TMap(TType.I32, TType.LIST, this.prop_names?.length));
      for (var elem126 in this.prop_names?.keys ?? <int>[]) {
        oprot.writeI32(elem126);
        {
          oprot.writeListBegin(
              new TList(TType.STRING, this.prop_names?[elem126]?.length));
          for (var elem127 in this.prop_names?[elem126] ?? []) {
            oprot.writeBinary(elem127);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_IF_NOT_EXISTS_FIELD_DESC);
  oprot.writeBool(this.if_not_exists);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_IGNORE_EXISTED_INDEX_FIELD_DESC);
  oprot.writeBool(this.ignore_existed_index);
  oprot.writeFieldEnd();
  if (isSetCommon()) {
    if (this.common != null) {
      oprot.writeFieldBegin(_COMMON_FIELD_DESC);
      this.common?.write(oprot);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}