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);
  if (this.space_name != null) {
    oprot.writeFieldBegin(_SPACE_NAME_FIELD_DESC);
    oprot.writeBinary(this.space_name);
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_PARTITION_NUM_FIELD_DESC);
  oprot.writeI32(this.partition_num);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_REPLICA_FACTOR_FIELD_DESC);
  oprot.writeI32(this.replica_factor);
  oprot.writeFieldEnd();
  if (this.charset_name != null) {
    oprot.writeFieldBegin(_CHARSET_NAME_FIELD_DESC);
    oprot.writeBinary(this.charset_name);
    oprot.writeFieldEnd();
  }
  if (this.collate_name != null) {
    oprot.writeFieldBegin(_COLLATE_NAME_FIELD_DESC);
    oprot.writeBinary(this.collate_name);
    oprot.writeFieldEnd();
  }
  if (this.vid_type != null) {
    oprot.writeFieldBegin(_VID_TYPE_FIELD_DESC);
    this.vid_type?.write(oprot);
    oprot.writeFieldEnd();
  }
  if (this.zone_names != null) {
    oprot.writeFieldBegin(_ZONE_NAMES_FIELD_DESC);
    {
      oprot.writeListBegin(new TList(TType.STRING, this.zone_names?.length));
      for (var elem7 in this.zone_names ?? []) {
        oprot.writeBinary(elem7);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  if (isSetIsolation_level()) {
    oprot.writeFieldBegin(_ISOLATION_LEVEL_FIELD_DESC);
    oprot.writeI32(this.isolation_level);
    oprot.writeFieldEnd();
  }
  if (isSetComment()) {
    if (this.comment != null) {
      oprot.writeFieldBegin(_COMMENT_FIELD_DESC);
      oprot.writeBinary(this.comment);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}