예제 #1
0
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // START
          if (field.type == TType.STRING) {
            this.start = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // FINISH
          if (field.type == TType.STRING) {
            this.finish = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // REVERSED
          if (field.type == TType.BOOL) {
            this.reversed = iprot.readBool();
            setReversedIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // COUNT
          if (field.type == TType.I32) {
            this.count = iprot.readI32();
            setCountIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    if (!isSetReversed()) {
      throw new TProtocolException(
          "Required field 'reversed' was not found in serialized data! Struct: " + toString());
    }
    if (!isSetCount()) {
      throw new TProtocolException(
          "Required field 'count' was not found in serialized data! Struct: " + toString());
    }
    validate();
  }
 public void read(TProtocol iprot) throws TException {
   TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == TType.STOP) {
       break;
     }
     switch (field.id) {
       case 2: // INCLUDE_TITLE
         if (field.type == TType.BOOL) {
           this.includeTitle = iprot.readBool();
           setIncludeTitleIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 5: // INCLUDE_CONTENT_LENGTH
         if (field.type == TType.BOOL) {
           this.includeContentLength = iprot.readBool();
           setIncludeContentLengthIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 6: // INCLUDE_CREATED
         if (field.type == TType.BOOL) {
           this.includeCreated = iprot.readBool();
           setIncludeCreatedIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 7: // INCLUDE_UPDATED
         if (field.type == TType.BOOL) {
           this.includeUpdated = iprot.readBool();
           setIncludeUpdatedIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 10: // INCLUDE_UPDATE_SEQUENCE_NUM
         if (field.type == TType.BOOL) {
           this.includeUpdateSequenceNum = iprot.readBool();
           setIncludeUpdateSequenceNumIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 11: // INCLUDE_NOTEBOOK_GUID
         if (field.type == TType.BOOL) {
           this.includeNotebookGuid = iprot.readBool();
           setIncludeNotebookGuidIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 12: // INCLUDE_TAG_GUIDS
         if (field.type == TType.BOOL) {
           this.includeTagGuids = iprot.readBool();
           setIncludeTagGuidsIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 14: // INCLUDE_ATTRIBUTES
         if (field.type == TType.BOOL) {
           this.includeAttributes = iprot.readBool();
           setIncludeAttributesIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 20: // INCLUDE_LARGEST_RESOURCE_MIME
         if (field.type == TType.BOOL) {
           this.includeLargestResourceMime = iprot.readBool();
           setIncludeLargestResourceMimeIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 21: // INCLUDE_LARGEST_RESOURCE_SIZE
         if (field.type == TType.BOOL) {
           this.includeLargestResourceSize = iprot.readBool();
           setIncludeLargestResourceSizeIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }