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 elem90 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem90);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem90]?.length));
          for (var elem91 in this.parts?[elem90] ?? <t_nebula.Row>[]) {
            elem91.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  if (isSetVertex_props()) {
    if (this.vertex_props != null) {
      oprot.writeFieldBegin(_VERTEX_PROPS_FIELD_DESC);
      {
        oprot.writeListBegin(
            new TList(TType.STRUCT, this.vertex_props?.length));
        for (var elem92 in this.vertex_props ?? <VertexProp>[]) {
          elem92.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  if (isSetEdge_props()) {
    if (this.edge_props != null) {
      oprot.writeFieldBegin(_EDGE_PROPS_FIELD_DESC);
      {
        oprot
            .writeListBegin(new TList(TType.STRUCT, this.edge_props?.length));
        for (var elem93 in this.edge_props ?? <EdgeProp>[]) {
          elem93.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  if (isSetExpressions()) {
    if (this.expressions != null) {
      oprot.writeFieldBegin(_EXPRESSIONS_FIELD_DESC);
      {
        oprot.writeListBegin(
            new TList(TType.STRUCT, this.expressions?.length));
        for (var elem94 in this.expressions ?? <Expr>[]) {
          elem94.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldBegin(_DEDUP_FIELD_DESC);
  oprot.writeBool(this.dedup);
  oprot.writeFieldEnd();
  if (isSetOrder_by()) {
    if (this.order_by != null) {
      oprot.writeFieldBegin(_ORDER_BY_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.STRUCT, this.order_by?.length));
        for (var elem95 in this.order_by ?? <OrderBy>[]) {
          elem95.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  if (isSetLimit()) {
    oprot.writeFieldBegin(_LIMIT_FIELD_DESC);
    oprot.writeI64(this.limit);
    oprot.writeFieldEnd();
  }
  if (isSetFilter()) {
    if (this.filter != null) {
      oprot.writeFieldBegin(_FILTER_FIELD_DESC);
      oprot.writeBinary(this.filter);
      oprot.writeFieldEnd();
    }
  }
  if (isSetCommon()) {
    if (this.common != null) {
      oprot.writeFieldBegin(_COMMON_FIELD_DESC);
      this.common?.write(oprot);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}