コード例 #1
0
 @Override
 protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
     throws org.apache.thrift.TException {
   switch (setField_) {
     case MODEL_ELEMENT_ADDITION:
       HawkModelElementAdditionEvent modelElementAddition = (HawkModelElementAdditionEvent) value_;
       modelElementAddition.write(oprot);
       return;
     case MODEL_ELEMENT_REMOVAL:
       HawkModelElementRemovalEvent modelElementRemoval = (HawkModelElementRemovalEvent) value_;
       modelElementRemoval.write(oprot);
       return;
     case MODEL_ELEMENT_ATTRIBUTE_UPDATE:
       HawkAttributeUpdateEvent modelElementAttributeUpdate = (HawkAttributeUpdateEvent) value_;
       modelElementAttributeUpdate.write(oprot);
       return;
     case MODEL_ELEMENT_ATTRIBUTE_REMOVAL:
       HawkAttributeRemovalEvent modelElementAttributeRemoval = (HawkAttributeRemovalEvent) value_;
       modelElementAttributeRemoval.write(oprot);
       return;
     case REFERENCE_ADDITION:
       HawkReferenceAdditionEvent referenceAddition = (HawkReferenceAdditionEvent) value_;
       referenceAddition.write(oprot);
       return;
     case REFERENCE_REMOVAL:
       HawkReferenceRemovalEvent referenceRemoval = (HawkReferenceRemovalEvent) value_;
       referenceRemoval.write(oprot);
       return;
     case SYNC_START:
       HawkSynchronizationStartEvent syncStart = (HawkSynchronizationStartEvent) value_;
       syncStart.write(oprot);
       return;
     case SYNC_END:
       HawkSynchronizationEndEvent syncEnd = (HawkSynchronizationEndEvent) value_;
       syncEnd.write(oprot);
       return;
     case FILE_ADDITION:
       HawkFileAdditionEvent fileAddition = (HawkFileAdditionEvent) value_;
       fileAddition.write(oprot);
       return;
     case FILE_REMOVAL:
       HawkFileRemovalEvent fileRemoval = (HawkFileRemovalEvent) value_;
       fileRemoval.write(oprot);
       return;
     default:
       throw new IllegalStateException("Cannot write union with unknown field " + setField_);
   }
 }
コード例 #2
0
 @Override
 protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(fieldID);
   if (setField != null) {
     switch (setField) {
       case MODEL_ELEMENT_ADDITION:
         HawkModelElementAdditionEvent modelElementAddition;
         modelElementAddition = new HawkModelElementAdditionEvent();
         modelElementAddition.read(iprot);
         return modelElementAddition;
       case MODEL_ELEMENT_REMOVAL:
         HawkModelElementRemovalEvent modelElementRemoval;
         modelElementRemoval = new HawkModelElementRemovalEvent();
         modelElementRemoval.read(iprot);
         return modelElementRemoval;
       case MODEL_ELEMENT_ATTRIBUTE_UPDATE:
         HawkAttributeUpdateEvent modelElementAttributeUpdate;
         modelElementAttributeUpdate = new HawkAttributeUpdateEvent();
         modelElementAttributeUpdate.read(iprot);
         return modelElementAttributeUpdate;
       case MODEL_ELEMENT_ATTRIBUTE_REMOVAL:
         HawkAttributeRemovalEvent modelElementAttributeRemoval;
         modelElementAttributeRemoval = new HawkAttributeRemovalEvent();
         modelElementAttributeRemoval.read(iprot);
         return modelElementAttributeRemoval;
       case REFERENCE_ADDITION:
         HawkReferenceAdditionEvent referenceAddition;
         referenceAddition = new HawkReferenceAdditionEvent();
         referenceAddition.read(iprot);
         return referenceAddition;
       case REFERENCE_REMOVAL:
         HawkReferenceRemovalEvent referenceRemoval;
         referenceRemoval = new HawkReferenceRemovalEvent();
         referenceRemoval.read(iprot);
         return referenceRemoval;
       case SYNC_START:
         HawkSynchronizationStartEvent syncStart;
         syncStart = new HawkSynchronizationStartEvent();
         syncStart.read(iprot);
         return syncStart;
       case SYNC_END:
         HawkSynchronizationEndEvent syncEnd;
         syncEnd = new HawkSynchronizationEndEvent();
         syncEnd.read(iprot);
         return syncEnd;
       case FILE_ADDITION:
         HawkFileAdditionEvent fileAddition;
         fileAddition = new HawkFileAdditionEvent();
         fileAddition.read(iprot);
         return fileAddition;
       case FILE_REMOVAL:
         HawkFileRemovalEvent fileRemoval;
         fileRemoval = new HawkFileRemovalEvent();
         fileRemoval.read(iprot);
         return fileRemoval;
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     throw new TProtocolException("Couldn't find a field with field id " + fieldID);
   }
 }
コード例 #3
0
 @Override
 protected Object standardSchemeReadValue(
     org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(field.id);
   if (setField != null) {
     switch (setField) {
       case MODEL_ELEMENT_ADDITION:
         if (field.type == MODEL_ELEMENT_ADDITION_FIELD_DESC.type) {
           HawkModelElementAdditionEvent modelElementAddition;
           modelElementAddition = new HawkModelElementAdditionEvent();
           modelElementAddition.read(iprot);
           return modelElementAddition;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case MODEL_ELEMENT_REMOVAL:
         if (field.type == MODEL_ELEMENT_REMOVAL_FIELD_DESC.type) {
           HawkModelElementRemovalEvent modelElementRemoval;
           modelElementRemoval = new HawkModelElementRemovalEvent();
           modelElementRemoval.read(iprot);
           return modelElementRemoval;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case MODEL_ELEMENT_ATTRIBUTE_UPDATE:
         if (field.type == MODEL_ELEMENT_ATTRIBUTE_UPDATE_FIELD_DESC.type) {
           HawkAttributeUpdateEvent modelElementAttributeUpdate;
           modelElementAttributeUpdate = new HawkAttributeUpdateEvent();
           modelElementAttributeUpdate.read(iprot);
           return modelElementAttributeUpdate;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case MODEL_ELEMENT_ATTRIBUTE_REMOVAL:
         if (field.type == MODEL_ELEMENT_ATTRIBUTE_REMOVAL_FIELD_DESC.type) {
           HawkAttributeRemovalEvent modelElementAttributeRemoval;
           modelElementAttributeRemoval = new HawkAttributeRemovalEvent();
           modelElementAttributeRemoval.read(iprot);
           return modelElementAttributeRemoval;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case REFERENCE_ADDITION:
         if (field.type == REFERENCE_ADDITION_FIELD_DESC.type) {
           HawkReferenceAdditionEvent referenceAddition;
           referenceAddition = new HawkReferenceAdditionEvent();
           referenceAddition.read(iprot);
           return referenceAddition;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case REFERENCE_REMOVAL:
         if (field.type == REFERENCE_REMOVAL_FIELD_DESC.type) {
           HawkReferenceRemovalEvent referenceRemoval;
           referenceRemoval = new HawkReferenceRemovalEvent();
           referenceRemoval.read(iprot);
           return referenceRemoval;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SYNC_START:
         if (field.type == SYNC_START_FIELD_DESC.type) {
           HawkSynchronizationStartEvent syncStart;
           syncStart = new HawkSynchronizationStartEvent();
           syncStart.read(iprot);
           return syncStart;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SYNC_END:
         if (field.type == SYNC_END_FIELD_DESC.type) {
           HawkSynchronizationEndEvent syncEnd;
           syncEnd = new HawkSynchronizationEndEvent();
           syncEnd.read(iprot);
           return syncEnd;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case FILE_ADDITION:
         if (field.type == FILE_ADDITION_FIELD_DESC.type) {
           HawkFileAdditionEvent fileAddition;
           fileAddition = new HawkFileAdditionEvent();
           fileAddition.read(iprot);
           return fileAddition;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case FILE_REMOVAL:
         if (field.type == FILE_REMOVAL_FIELD_DESC.type) {
           HawkFileRemovalEvent fileRemoval;
           fileRemoval = new HawkFileRemovalEvent();
           fileRemoval.read(iprot);
           return fileRemoval;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     return null;
   }
 }