コード例 #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, RemoteInterpreterContext struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.noteId != null) {
        oprot.writeFieldBegin(NOTE_ID_FIELD_DESC);
        oprot.writeString(struct.noteId);
        oprot.writeFieldEnd();
      }
      if (struct.paragraphId != null) {
        oprot.writeFieldBegin(PARAGRAPH_ID_FIELD_DESC);
        oprot.writeString(struct.paragraphId);
        oprot.writeFieldEnd();
      }
      if (struct.paragraphTitle != null) {
        oprot.writeFieldBegin(PARAGRAPH_TITLE_FIELD_DESC);
        oprot.writeString(struct.paragraphTitle);
        oprot.writeFieldEnd();
      }
      if (struct.paragraphText != null) {
        oprot.writeFieldBegin(PARAGRAPH_TEXT_FIELD_DESC);
        oprot.writeString(struct.paragraphText);
        oprot.writeFieldEnd();
      }
      if (struct.authenticationInfo != null) {
        oprot.writeFieldBegin(AUTHENTICATION_INFO_FIELD_DESC);
        oprot.writeString(struct.authenticationInfo);
        oprot.writeFieldEnd();
      }
      if (struct.config != null) {
        oprot.writeFieldBegin(CONFIG_FIELD_DESC);
        oprot.writeString(struct.config);
        oprot.writeFieldEnd();
      }
      if (struct.gui != null) {
        oprot.writeFieldBegin(GUI_FIELD_DESC);
        oprot.writeString(struct.gui);
        oprot.writeFieldEnd();
      }
      if (struct.runners != null) {
        oprot.writeFieldBegin(RUNNERS_FIELD_DESC);
        oprot.writeString(struct.runners);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterContext 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: // NOTE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.noteId = iprot.readString();
              struct.setNoteIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PARAGRAPH_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.paragraphId = iprot.readString();
              struct.setParagraphIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PARAGRAPH_TITLE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.paragraphTitle = iprot.readString();
              struct.setParagraphTitleIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PARAGRAPH_TEXT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.paragraphText = iprot.readString();
              struct.setParagraphTextIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // AUTHENTICATION_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.authenticationInfo = iprot.readString();
              struct.setAuthenticationInfoIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CONFIG
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.config = iprot.readString();
              struct.setConfigIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // GUI
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.gui = iprot.readString();
              struct.setGuiIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // RUNNERS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.runners = iprot.readString();
              struct.setRunnersIsSet(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();
    }