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.name != null) {
    oprot.writeFieldBegin(_NAME_FIELD_DESC);
    oprot.writeBinary(this.name);
    oprot.writeFieldEnd();
  }
  if (this.type != null) {
    oprot.writeFieldBegin(_TYPE_FIELD_DESC);
    this.type?.write(oprot);
    oprot.writeFieldEnd();
  }
  if (isSetDefault_value()) {
    if (this.default_value != null) {
      oprot.writeFieldBegin(_DEFAULT_VALUE_FIELD_DESC);
      oprot.writeBinary(this.default_value);
      oprot.writeFieldEnd();
    }
  }
  if (isSetNullable()) {
    oprot.writeFieldBegin(_NULLABLE_FIELD_DESC);
    oprot.writeBool(this.nullable);
    oprot.writeFieldEnd();
  }
  if (isSetComment()) {
    if (this.comment != null) {
      oprot.writeFieldBegin(_COMMENT_FIELD_DESC);
      oprot.writeBinary(this.comment);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}