On January 27th, this site will be read-only as we migrate to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,632 Users
  • 2,269,769 Discussions
  • 7,916,800 Comments

Discussions

Java - if records are invalid records, write to a excel file

4281104
4281104 Member Posts: 2
edited Sep 17, 2020 4:43AM in Java User Groups Discussions

My code validates if the file has valid records or invalid records**(see invalidApplicantTypeRecords)** if the records are invalid, I need to write it to a file. how do I do that in this code

<span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">public</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">class</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EdcCebaProcessor</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">public</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">void</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> startProcessing</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">()</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">List</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">String</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> fileNames </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> inputFileHandler</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">fetchInputFileNames</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">();</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">for</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">String</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> fileName </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">:</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> fileNames</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">OutputRecords</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> outputRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> generateOutputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">fileName</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">List</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCOutputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> listOfEdcOutputRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> outputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">getValidOutputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">();</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">List</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCOutputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> listOfInvalidApplicantTypeRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> outputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">getInvalidApplicantTypeRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">();</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  outputFileWriter</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">writeIntoFile</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">listOfEdcOutputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  inputFileHandler</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">moveInputFileToProcessedDirectory</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">fileName</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">private</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">OutputRecords</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> generateOutputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">String</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> fileLocation</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">ArrayList</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">CSVRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> csvRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">List</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCOutputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> outputRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">ArrayList</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><>();</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">List</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCOutputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">></span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> invalidApplicantTypeRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">ArrayList</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><>();</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">try</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCOutputRecord</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> outputRecord </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">null</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  csvRecords </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">ArrayList</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">CSVRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">>)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">this</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">csvRecordsParser</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">getCSVRecordsFromFile</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">fileLocation</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">for</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">CSVRecord</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> record </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">:</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> csvRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">try</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  edcRecordValidator</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">validateRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">record</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  outputRecord </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> edcOutputRecordCreator</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">buildValidRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCInputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">record</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">));</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">catch</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">FieldValidationException</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> e</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">if</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">e</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">getFailedValidationField</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">().</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">equals</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCRecordField</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">APPLICANT_TYPE</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">))</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  log</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">error</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="str" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--red-800);">"Invalid Applicant Type for the record number: "</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">+</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> record</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">getRecordNumber</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">());</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  outputRecord </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> edcOutputRecordCreator</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">buildInvalidBNFormatRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCInputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">record</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">));</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="com" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-400);">// Object to keep track of the Invalid Applicant Type Values.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  invalidApplicantTypeRecords<br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">add</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">edcOutputRecordCreator</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">buildInvalidBNFormatRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">EDCInputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">record</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)));</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> <br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  outputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">add</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">outputRecord</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> <br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">return</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">new</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> </span><span class="typ" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: #2b91af;">OutputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">outputRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">,</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> invalidApplicantTypeRecords</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/></span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span>

Answers