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 elem339 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem339);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem339]?.length));
          for (var elem340 in this.parts?[elem339] ?? <NewEdge>[]) {
            elem340.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  if (this.prop_names != null) {
    oprot.writeFieldBegin(_PROP_NAMES_FIELD_DESC);
    {
      oprot.writeListBegin(new TList(TType.STRING, this.prop_names?.length));
      for (var elem341 in this.prop_names ?? <Int8List>[]) {
        oprot.writeBinary(elem341);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_IF_NOT_EXISTS_FIELD_DESC);
  oprot.writeBool(this.if_not_exists);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_TERM_FIELD_DESC);
  oprot.writeI64(this.term);
  oprot.writeFieldEnd();
  if (isSetEdge_version()) {
    oprot.writeFieldBegin(_EDGE_VERSION_FIELD_DESC);
    oprot.writeI64(this.edge_version);
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}