public void write()

in finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/RequestHeader.java [1165:1237]


    public void write(org.apache.thrift.protocol.TProtocol oprot, RequestHeader struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TRACE_ID_FIELD_DESC);
      oprot.writeI64(struct.trace_id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SPAN_ID_FIELD_DESC);
      oprot.writeI64(struct.span_id);
      oprot.writeFieldEnd();
      if (struct.isSetParent_span_id()) {
        oprot.writeFieldBegin(PARENT_SPAN_ID_FIELD_DESC);
        oprot.writeI64(struct.parent_span_id);
        oprot.writeFieldEnd();
      }
      if (struct.isSetSampled()) {
        oprot.writeFieldBegin(SAMPLED_FIELD_DESC);
        oprot.writeBool(struct.sampled);
        oprot.writeFieldEnd();
      }
      if (struct.client_id != null) {
        if (struct.isSetClient_id()) {
          oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC);
          struct.client_id.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetFlags()) {
        oprot.writeFieldBegin(FLAGS_FIELD_DESC);
        oprot.writeI64(struct.flags);
        oprot.writeFieldEnd();
      }
      if (struct.contexts != null) {
        oprot.writeFieldBegin(CONTEXTS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.contexts.size()));
          for (RequestContext _iter22 : struct.contexts)
          {
            _iter22.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.dest != null) {
        if (struct.isSetDest()) {
          oprot.writeFieldBegin(DEST_FIELD_DESC);
          oprot.writeString(struct.dest);
          oprot.writeFieldEnd();
        }
      }
      if (struct.delegations != null) {
        if (struct.isSetDelegations()) {
          oprot.writeFieldBegin(DELEGATIONS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.delegations.size()));
            for (Delegation _iter23 : struct.delegations)
            {
              _iter23.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetTrace_id_high()) {
        oprot.writeFieldBegin(TRACE_ID_HIGH_FIELD_DESC);
        oprot.writeI64(struct.trace_id_high);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }