Exemplo n.º 1
0
  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.guid != null) {
      if (isSetGuid()) {
        oprot.writeFieldBegin(GUID_FIELD_DESC);
        oprot.writeString(this.guid);
        oprot.writeFieldEnd();
      }
    }
    if (this.name != null) {
      if (isSetName()) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(this.name);
        oprot.writeFieldEnd();
      }
    }
    if (this.query != null) {
      if (isSetQuery()) {
        oprot.writeFieldBegin(QUERY_FIELD_DESC);
        oprot.writeString(this.query);
        oprot.writeFieldEnd();
      }
    }
    if (this.format != null) {
      if (isSetFormat()) {
        oprot.writeFieldBegin(FORMAT_FIELD_DESC);
        oprot.writeI32(this.format.getValue());
        oprot.writeFieldEnd();
      }
    }
    if (isSetUpdateSequenceNum()) {
      oprot.writeFieldBegin(UPDATE_SEQUENCE_NUM_FIELD_DESC);
      oprot.writeI32(this.updateSequenceNum);
      oprot.writeFieldEnd();
    }
    if (this.scope != null) {
      if (isSetScope()) {
        oprot.writeFieldBegin(SCOPE_FIELD_DESC);
        this.scope.write(oprot);
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }
Exemplo n.º 2
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: // GUID
         if (field.type == TType.STRING) {
           this.guid = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // NAME
         if (field.type == TType.STRING) {
           this.name = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 3: // QUERY
         if (field.type == TType.STRING) {
           this.query = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 4: // FORMAT
         if (field.type == TType.I32) {
           this.format = QueryFormat.findByValue(iprot.readI32());
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 5: // UPDATE_SEQUENCE_NUM
         if (field.type == TType.I32) {
           this.updateSequenceNum = iprot.readI32();
           setUpdateSequenceNumIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 6: // SCOPE
         if (field.type == TType.STRUCT) {
           this.scope = new SavedSearchScope();
           this.scope.read(iprot);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
Exemplo n.º 3
0
  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldBegin(START_INDEX_FIELD_DESC);
    oprot.writeI32(this.startIndex);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(TOTAL_NOTES_FIELD_DESC);
    oprot.writeI32(this.totalNotes);
    oprot.writeFieldEnd();
    if (this.notes != null) {
      oprot.writeFieldBegin(NOTES_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.STRUCT, this.notes.size()));
        for (com.evernote.edam.type.Note _iter57 : this.notes) {
          _iter57.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    if (this.stoppedWords != null) {
      if (isSetStoppedWords()) {
        oprot.writeFieldBegin(STOPPED_WORDS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRING, this.stoppedWords.size()));
          for (String _iter58 : this.stoppedWords) {
            oprot.writeString(_iter58);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
    }
    if (this.searchedWords != null) {
      if (isSetSearchedWords()) {
        oprot.writeFieldBegin(SEARCHED_WORDS_FIELD_DESC);
        {
          oprot.writeListBegin(new TList(TType.STRING, this.searchedWords.size()));
          for (String _iter59 : this.searchedWords) {
            oprot.writeString(_iter59);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
    }
    if (isSetUpdateCount()) {
      oprot.writeFieldBegin(UPDATE_COUNT_FIELD_DESC);
      oprot.writeI32(this.updateCount);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }
Exemplo n.º 4
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_INDEX
         if (field.type == TType.I32) {
           this.startIndex = iprot.readI32();
           setStartIndexIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // TOTAL_NOTES
         if (field.type == TType.I32) {
           this.totalNotes = iprot.readI32();
           setTotalNotesIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 3: // NOTES
         if (field.type == TType.LIST) {
           {
             TList _list48 = iprot.readListBegin();
             this.notes = new ArrayList<com.evernote.edam.type.Note>(_list48.size);
             for (int _i49 = 0; _i49 < _list48.size; ++_i49) {
               com.evernote.edam.type.Note _elem50;
               _elem50 = new com.evernote.edam.type.Note();
               _elem50.read(iprot);
               this.notes.add(_elem50);
             }
             iprot.readListEnd();
           }
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 4: // STOPPED_WORDS
         if (field.type == TType.LIST) {
           {
             TList _list51 = iprot.readListBegin();
             this.stoppedWords = new ArrayList<String>(_list51.size);
             for (int _i52 = 0; _i52 < _list51.size; ++_i52) {
               String _elem53;
               _elem53 = iprot.readString();
               this.stoppedWords.add(_elem53);
             }
             iprot.readListEnd();
           }
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 5: // SEARCHED_WORDS
         if (field.type == TType.LIST) {
           {
             TList _list54 = iprot.readListBegin();
             this.searchedWords = new ArrayList<String>(_list54.size);
             for (int _i55 = 0; _i55 < _list54.size; ++_i55) {
               String _elem56;
               _elem56 = iprot.readString();
               this.searchedWords.add(_elem56);
             }
             iprot.readListEnd();
           }
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 6: // UPDATE_COUNT
         if (field.type == TType.I32) {
           this.updateCount = iprot.readI32();
           setUpdateCountIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (isSetSubjectDate()) {
      oprot.writeFieldBegin(SUBJECT_DATE_FIELD_DESC);
      oprot.writeI64(this.subjectDate);
      oprot.writeFieldEnd();
    }
    if (isSetLatitude()) {
      oprot.writeFieldBegin(LATITUDE_FIELD_DESC);
      oprot.writeDouble(this.latitude);
      oprot.writeFieldEnd();
    }
    if (isSetLongitude()) {
      oprot.writeFieldBegin(LONGITUDE_FIELD_DESC);
      oprot.writeDouble(this.longitude);
      oprot.writeFieldEnd();
    }
    if (isSetAltitude()) {
      oprot.writeFieldBegin(ALTITUDE_FIELD_DESC);
      oprot.writeDouble(this.altitude);
      oprot.writeFieldEnd();
    }
    if (this.author != null) {
      if (isSetAuthor()) {
        oprot.writeFieldBegin(AUTHOR_FIELD_DESC);
        oprot.writeString(this.author);
        oprot.writeFieldEnd();
      }
    }
    if (this.source != null) {
      if (isSetSource()) {
        oprot.writeFieldBegin(SOURCE_FIELD_DESC);
        oprot.writeString(this.source);
        oprot.writeFieldEnd();
      }
    }
    if (this.sourceURL != null) {
      if (isSetSourceURL()) {
        oprot.writeFieldBegin(SOURCE_URL_FIELD_DESC);
        oprot.writeString(this.sourceURL);
        oprot.writeFieldEnd();
      }
    }
    if (this.sourceApplication != null) {
      if (isSetSourceApplication()) {
        oprot.writeFieldBegin(SOURCE_APPLICATION_FIELD_DESC);
        oprot.writeString(this.sourceApplication);
        oprot.writeFieldEnd();
      }
    }
    if (isSetShareDate()) {
      oprot.writeFieldBegin(SHARE_DATE_FIELD_DESC);
      oprot.writeI64(this.shareDate);
      oprot.writeFieldEnd();
    }
    if (this.placeName != null) {
      if (isSetPlaceName()) {
        oprot.writeFieldBegin(PLACE_NAME_FIELD_DESC);
        oprot.writeString(this.placeName);
        oprot.writeFieldEnd();
      }
    }
    if (this.contentClass != null) {
      if (isSetContentClass()) {
        oprot.writeFieldBegin(CONTENT_CLASS_FIELD_DESC);
        oprot.writeString(this.contentClass);
        oprot.writeFieldEnd();
      }
    }
    if (this.applicationData != null) {
      if (isSetApplicationData()) {
        oprot.writeFieldBegin(APPLICATION_DATA_FIELD_DESC);
        this.applicationData.write(oprot);
        oprot.writeFieldEnd();
      }
    }
    if (this.lastEditedBy != null) {
      if (isSetLastEditedBy()) {
        oprot.writeFieldBegin(LAST_EDITED_BY_FIELD_DESC);
        oprot.writeString(this.lastEditedBy);
        oprot.writeFieldEnd();
      }
    }
    if (this.classifications != null) {
      if (isSetClassifications()) {
        oprot.writeFieldBegin(CLASSIFICATIONS_FIELD_DESC);
        {
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.classifications.size()));
          for (Map.Entry<String, String> _iter21 : this.classifications.entrySet()) {
            oprot.writeString(_iter21.getKey());
            oprot.writeString(_iter21.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }
 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: // SUBJECT_DATE
         if (field.type == TType.I64) {
           this.subjectDate = iprot.readI64();
           setSubjectDateIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 10: // LATITUDE
         if (field.type == TType.DOUBLE) {
           this.latitude = iprot.readDouble();
           setLatitudeIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 11: // LONGITUDE
         if (field.type == TType.DOUBLE) {
           this.longitude = iprot.readDouble();
           setLongitudeIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 12: // ALTITUDE
         if (field.type == TType.DOUBLE) {
           this.altitude = iprot.readDouble();
           setAltitudeIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 13: // AUTHOR
         if (field.type == TType.STRING) {
           this.author = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 14: // SOURCE
         if (field.type == TType.STRING) {
           this.source = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 15: // SOURCE_URL
         if (field.type == TType.STRING) {
           this.sourceURL = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 16: // SOURCE_APPLICATION
         if (field.type == TType.STRING) {
           this.sourceApplication = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 17: // SHARE_DATE
         if (field.type == TType.I64) {
           this.shareDate = iprot.readI64();
           setShareDateIsSet(true);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 21: // PLACE_NAME
         if (field.type == TType.STRING) {
           this.placeName = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 22: // CONTENT_CLASS
         if (field.type == TType.STRING) {
           this.contentClass = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 23: // APPLICATION_DATA
         if (field.type == TType.STRUCT) {
           this.applicationData = new LazyMap();
           this.applicationData.read(iprot);
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 24: // LAST_EDITED_BY
         if (field.type == TType.STRING) {
           this.lastEditedBy = iprot.readString();
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 26: // CLASSIFICATIONS
         if (field.type == TType.MAP) {
           {
             TMap _map17 = iprot.readMapBegin();
             this.classifications = new HashMap<String, String>(2 * _map17.size);
             for (int _i18 = 0; _i18 < _map17.size; ++_i18) {
               String _key19;
               String _val20;
               _key19 = iprot.readString();
               _val20 = iprot.readString();
               this.classifications.put(_key19, _val20);
             }
             iprot.readMapEnd();
           }
         } else {
           TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }