Пример #1
0
 protected void finish(SportsOlympicsEventSchedulesAndResultsInstanceJSON result)
 {
     if (fieldGeneratorEvent.have_value)
     {
         result.setEvent(fieldGeneratorEvent.value);
         fieldGeneratorEvent.have_value = false;
     }
     else if ((!(result.hasEvent())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Event\" field was missing.");
     }
     if (fieldGeneratorEventCategory.have_value)
     {
         result.setEventCategory(fieldGeneratorEventCategory.value);
         fieldGeneratorEventCategory.have_value = false;
     }
     else if ((!(result.hasEventCategory())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"EventCategory\" field was missing.");
     }
     if (fieldGeneratorInstanceDescription.have_value)
     {
         result.setInstanceDescription(fieldGeneratorInstanceDescription.value);
         fieldGeneratorInstanceDescription.have_value = false;
     }
     if (fieldGeneratorGames.have_value)
     {
         result.setGames(fieldGeneratorGames.value);
         fieldGeneratorGames.have_value = false;
     }
     else if ((!(result.hasGames())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Games\" field was missing.");
     }
     if (fieldGeneratorMedalEvent.have_value)
     {
         result.setMedalEvent(fieldGeneratorMedalEvent.value);
         fieldGeneratorMedalEvent.have_value = false;
     }
     if (fieldGeneratorGeneralSummary.have_value)
     {
         result.setGeneralSummary(fieldGeneratorGeneralSummary.value);
         fieldGeneratorGeneralSummary.have_value = false;
     }
     if (fieldGeneratorStartTime.have_value)
     {
         result.setStartTime(fieldGeneratorStartTime.value);
         fieldGeneratorStartTime.have_value = false;
     }
     if (fieldGeneratorMedalWinners.have_value)
     {
         result.initMedalWinners();
         int count = fieldGeneratorMedalWinners.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendMedalWinners(fieldGeneratorMedalWinners.value[num]);
         }
         fieldGeneratorMedalWinners.value.Clear();
         fieldGeneratorMedalWinners.have_value = false;
     }
     if (fieldGeneratorParticipants.have_value)
     {
         result.initParticipants();
         int count = fieldGeneratorParticipants.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendParticipants(fieldGeneratorParticipants.value[num]);
         }
         fieldGeneratorParticipants.value.Clear();
         fieldGeneratorParticipants.have_value = false;
     }
     if (fieldGeneratorUpcoming.have_value)
     {
         result.setUpcoming(fieldGeneratorUpcoming.value);
         fieldGeneratorUpcoming.have_value = false;
     }
 }