public void read()

in finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/RequestHeader.java [1041:1163]


    public void read(org.apache.thrift.protocol.TProtocol iprot, RequestHeader struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // TRACE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.trace_id = iprot.readI64();
              struct.setTrace_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SPAN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.span_id = iprot.readI64();
              struct.setSpan_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PARENT_SPAN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.parent_span_id = iprot.readI64();
              struct.setParent_span_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SAMPLED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.sampled = iprot.readBool();
              struct.setSampledIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CLIENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.client_id = new ClientId();
              struct.client_id.read(iprot);
              struct.setClient_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // FLAGS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.flags = iprot.readI64();
              struct.setFlagsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // CONTEXTS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                struct.contexts = new java.util.ArrayList<RequestContext>(_list16.size);
                RequestContext _elem17;
                for (int _i18 = 0; _i18 < _list16.size; ++_i18)
                {
                  _elem17 = new RequestContext();
                  _elem17.read(iprot);
                  struct.contexts.add(_elem17);
                }
                iprot.readListEnd();
              }
              struct.setContextsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // DEST
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.dest = iprot.readString();
              struct.setDestIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // DELEGATIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list19 = iprot.readListBegin();
                struct.delegations = new java.util.ArrayList<Delegation>(_list19.size);
                Delegation _elem20;
                for (int _i21 = 0; _i21 < _list19.size; ++_i21)
                {
                  _elem20 = new Delegation();
                  _elem20.read(iprot);
                  struct.delegations.add(_elem20);
                }
                iprot.readListEnd();
              }
              struct.setDelegationsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // TRACE_ID_HIGH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.trace_id_high = iprot.readI64();
              struct.setTrace_id_highIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }