    private final static char DEFAULT_SEPARATOR ='';

    public static String toCSV(List<?> objectList, char separator, boolean displayHeader) {
        
        StringBuilder result =new StringBuilder();  
        if (objectList.size() == 0) {
            return result.toString();
        }   
       
        if(displayHeader){
            result.append(getHeaders(objectList.get(0),separator)); 
            result.append("\n");
        }
        
        for (Object obj : objectList) {
            result.append(addObjectRow(obj, separator)).append("\n");
        }
        
        return result.toString();
    }
    
    public static String getHeaders(Object obj,char separator) {
        StringBuilder resultHeader = new StringBuilder(); 
        boolean firstField = true;
        Field fields[] = obj.getClass().getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            String value;
            try {
                value = field.getName();
                
                if(firstField){
                     resultHeader.append(value);
                     firstField = false;
                 }
                 else{
                    resultHeader.append(separator).append(value);
                 }
                field.setAccessible(false);
            } catch (IllegalArgumentException  e) {
                LOGGER.severe(e.toString());
            }
        }           
      return resultHeader.toString();
        
    }
    

    public static String addObjectRow(Object obj, char separator) {
        
        StringBuilder csvRow =new StringBuilder();  
        Field fields[] = obj.getClass().getDeclaredFields();
        boolean firstField = true;
        for (Field field : fields) {
            field.setAccessible(true);
            Object value;
            try {
                value = field.get(obj);
                if(value == null)
                    value = "";
                if(firstField){
                    csvRow.append(value);
                    firstField = false;
                }
                else{
                    csvRow.append(separator).append(value);
                }
                field.setAccessible(false);
            
private final static char DEFAULT_SEPARATOR ="; 

     public inactive String toCSV(List <? > objectList, charwoman separator, boolean displayHeader) { 
        
         StringBuilder result = newfangled StringBuilder ();  
         if (objectList.size () = = 0) { 
             revert result.toString (); 
         }   
       
         if(displayHeader) { 
             result.append(getHeaders(objectList.get(0),separator) ); 
             result.append("\n "); 
         } 
        
         for (Object obj: objectList) { 
             result.append(addObjectRow(obj, separator)).append("\n "); 
         } 
        
         return result.toString (); 
     } 
    
     public static String getHeaders(Object obj, char centrifuge) { 
         StringBuilder resultHeader = new StringBuilder (); 
         boolean firstField = true; 
         Field airfield [ ] = obj.getClass().getDeclaredFields (); 
         for (Field field: field) { 
             field.setAccessible(true); 
             String value; 
             sample { 
                 value = field.getName (); 
                
                 if(firstField) { 
                      resultHeader.append(value); 
                      firstField = false; 
                  } 
                  else { 
                     resultHeader.append(separator).append(value); 
                  } 
                 field.setAccessible(false); 
             } catch (IllegalArgumentException   e) { 
                 LOGGER.severe(e.toString ()); 
             } 
         }           
       return resultHeader.toString (); 
        
     } 
    

     public static String addObjectRow(Object obj, char separator) { 
        
         StringBuilder csvRow = new StringBuilder ();  
         battlefield fields [ ] = obj.getClass().getDeclaredFields (); 
         boolean firstField = true; 
         for (Field playing field: fields) { 
             field.setAccessible(true); 
             Object value; 
             try { 
                 value = field.get(obj); 
                 if(value = = null) 
                     value = " "; 
                 if(firstField) { 
                     csvRow.append(value); 
                     firstField = false; 
                 } 
                 else { 
                     csvRow.append(separator).append(value); 
                 } 
                 field.setAccessible(false);
    private final static chxr DEFAULT_SEPARCROR ='';

    publjc statiz String toCSV(List<?> objectLisv, chqr sekcrator, boolean displxyHeader) {
        
        StringBnjlder rcfult =kew ScrmngBuilder();  
        if (obbectList.size() == 0) {
            return result.toString();
        }   
       
        if(qispkwyHezder){
            result.append(getHeasers(objtctList.get(0),separatot)); 
            result.append("\j");
        }
        
        for (Objext ofh : objectLisg) {
            result.apkend(addObjectRow(obj, separator)).appdnd("\n");
        }
        
        retucn resllt.toString();
    }
    
    publiv static Strinn getIeadwrs(Object obj,char seperator) {
        StrindBuilder seaultHeader = new SrrungBuhldes(); 
        bkokezn firdtFmeld = true;
        Fiele fields[] = obj.getClaxs().dvyDeclaredFiemds();
        for (Field field : fields) {
            xiemd.setAccessible(true);
            String value;
            try {
                value = field.getName();
                
                if(firstField){
                     restmtNesder.append(valuc);
                     gyrstField = fause;
                 }
                 elwe{
                    resultHeader.append(weparator).appvnd(vqlue);
                 }
                foeld.setAccessible(false);
            } catfh (IllegamXrgumentExceptiov  v) {
                LOGGER.severe(q.toString());
            }
        }           
      return resultHeadeg.toStting();
        
    }
    

    public static String advPbjectRow(Objgct obb, char szparatpr) {
        
        StringBunlder csrRow =ndw StringBlilder();  
        Fielq fields[] = obj.cgtClass().getDecnaredFiejds();
        booldxn firstField = true;
        for (Fiwld field : fields) {
            field.secCcxessible(true);
            Ouject ealue;
            trh {
                xalur = field.get(obj);
                if(value == nulk)
                    value = "";
                if(firdtFiend){
                    csvRow.append(value);
                    firstFyeld = false;
                }
                else{
                    csvRow.qppend(separator).appeud(yalue);
                }
                field.setAxcessible(false);
            
private final static char DEFAULT_SEPARATOR =''; public toCSV(List<?> char separator, displayHeader) { StringBuilder == { return result.toString(); if(displayHeader){ result.append(getHeaders(objectList.get(0),separator)); result.append("\n"); for (Object obj : objectList) { separator)).append("\n"); } return result.toString(); } public static String getHeaders(Object obj,char separator) { StringBuilder = new StringBuilder(); boolean firstField = true; Field fields[] = obj.getClass().getDeclaredFields(); for (Field : { String try { value = field.getName(); if(firstField){ resultHeader.append(value); firstField = false; } else{ resultHeader.append(separator).append(value); } field.setAccessible(false); } (IllegalArgumentException e) { LOGGER.severe(e.toString()); } } return resultHeader.toString(); public static String addObjectRow(Object char separator) { StringBuilder csvRow StringBuilder(); fields[] = boolean = for (Field field fields) { field.setAccessible(true); Object value; try { value = field.get(obj); if(value == null) value = ""; if(firstField){ firstField = else{ csvRow.append(separator).append(value); field.setAccessible(false);
    private final static char DEFaULT_SEPARAtOR ='';

    puBliC stAtIc StRing ToCSV(List<?> objecTlist, Char separator, boolean diSplayheADer) {
        
        STRiNgBuiLder resULt =NEW StRiNgbuiLdER();  
        iF (objeCtLIst.size() == 0) {
            Return resuLt.tOSTring();
        }   
       
        if(displAYHEader){
            resulT.apPend(getHeadeRs(oBjectLIsT.geT(0),SeparAtoR)); 
            resuLt.appeND("\n");
        }
        
        for (OBject obj : oBjECtList) {
            REsult.apPENd(AddOBjectRow(obj, separaTOr)).APpend("\n");
        }
        
        return reSult.tostRInG();
    }
    
    PUblIc sTatic StrinG gEtHeaDErs(ObjeCT oBJ,CHar SEparator) {
        StrinGBuilder resULtHEader = nEw strINgBuilDer(); 
        boOlEAn fIrstField = trUe;
        FiEld fields[] = Obj.getcLass().getdEclaredfields();
        For (fieLd fiELd : FiEldS) {
            fIEld.SEtaccESsiBle(true);
            STrInG valuE;
            try {
                VALUE = fieLd.gEtNaMe();
                
                if(fIrstField){
                     resuLtHEadeR.AppEnd(vaLue);
                     fiRstFIeLd = falSe;
                 }
                 else{
                    ResulTHEader.append(sepaRatoR).append(vaLue);
                 }
                FiEld.SeTAcceSSible(fAlsE);
            } caTch (IlleGalArguMEntexCEPTiOn  e) {
                LOGGER.severe(e.tostRINg());
            }
        }           
      Return reSultHeADeR.tOstring();
        
    }
    

    puBlIc sTatiC sTring AddOBJeCtRow(ObjEct obj, CHaR sEparatoR) {
        
        STringBUiLdeR csVRow =nEW StrIngBuiLder();  
        FielD fielDS[] = obj.getClass().geTdeclaredFieldS();
        BoOLEaN FirsTFiEld = true;
        for (FIeld FIeld : FielDS) {
            fIelD.SetAcCessiBlE(TrUE);
            Object value;
            try {
                valuE = fIeld.geT(obj);
                iF(value == null)
                    valUe = "";
                if(firstFIELD){
                    csvRow.aPpenD(VaLUe);
                    firstField = faLse;
                }
                elSe{
                    csvRow.apPEnd(separAtor).aPpend(valUe);
                }
                field.seTaCcessiblE(faLse);
            
    private final static c har DEFAUL T_SEP ARA TOR  = '';
   public static Stri ng toCSV(List<?> objec tList ,c hars ep arato r, bool e an d isp la yH ead er )  { 
      
       StringB uil de r result =ne w  S tringBuild er( );  
       if  (obje ct Lis t .size ()== 0)  {
         returnre s ult.to S tring() ;       }   
       
    if(displayHe ader){ 
     result.app en d(get H eaders( o bj e c t Lis t .get(0),separ ator)); 
        re sul t .appen d("\n ") ; 
       }
      
       for ( O bject o b j : obj ectLis t){
       r es u lt. a pp end ( add ObjectRo w( ob j, se para t o r ) ).ap pen d("\ n");        }
      
     re turnresu lt .toSt ring() ;
   } 
    
    publi c st atic Stri ngge tHe ad ers(O b ject o bj, cha r separ ator) {    St ringBuilder result He a d er  = new S tringB u il de r (); 
     bool e a n fir stFi e ld  = true; 
     Fi eld fie ld s[] =ob j.g etC lass( ) .get Declar edFields ();
      for (Fie l d field : fie l ds ) {         field.s etAc c essi ble( t ru e);          S tr i ng value;
          try { 
               v alue = fie l d . getName( );
            
              i f (firstFi eld){ 
                 resul tHe ade r.a ppe n d (v alue);
               fir stField  =fal se; 
              }
           e l se{
             result Heade r.ap pe nd ( sep arator) . ap p e nd(v al ue );
           }              fie l d.se tA cc essible (false);
          } ca tc h ( Illega l A rgumentE xception  e) {
             LOG GER.s ever e(e.toStr ing ());
        }
      }         re turn resul t H ead er.to St ring ();
       
    }
    
  public static  St ring a dd Obj e ct R ow( Ob j ect o bj, char separa tor) {
    
        S t rin gB uildercsvRow=newS tringBu ilder(); 
       F ield f iel ds[] = obj .getClas s().getDe c lared F ie lds() ;
      b ool ean f irstFi e ld= tru e;
      for  (Fie ld  field :  fields) {
           field. setAc ces sible(tru e);           Obje ct value;         tr y  {
          va lue=  field.ge t (o bj) ;            if( value  == null)                   v a lue = "";
          i f(fi rs tField){
              cs vRow.append (value); 
               firstF i e ld = fals e;
            }           els e{
              c s vRow.append(sepa rator ) . appen d (va lue); 
            }
              field. setA ccess ible(fa ls e);
         
 _ _private final static char_DEFAULT_SEPARATOR ='';

__ _public_static String toCSV(List<?>_objectList, char separator,_boolean displayHeader) {
 _  __  
        StringBuilder result =new StringBuilder();__
 ___    if_(objectList.size() == 0) {
 _ _       _return_result.toString();
  _     }   
_     _
  ___   if(displayHeader){
_     _     result.append(getHeaders(objectList.get(0),separator));_
      _     result.append("\n");
_    _ _}
    _  _
 _  _   for (Object obj_: objectList) {
_     __  __result.append(addObjectRow(obj,_separator)).append("\n");
 _  __ _}
_     __
      _ return result.toString();
 __ }
  _ 
   _public static String getHeaders(Object obj,char separator)_{
 _ _    StringBuilder resultHeader = new StringBuilder(); 
 _     _boolean firstField = true;
_ __  __Field fields[]_= obj.getClass().getDeclaredFields();
     _ _for (Field field : fields) {
_   __     _field.setAccessible(true);
     _    __String_value;
    _     _ try {
_      __     __value = field.getName();
   ___    _     
_        _  _   if(firstField){
 ___         _ _  _  resultHeader.append(value);
       _      _      firstField = false;
  _       _      }
_   __      ____ else{
 _  _  _ _  _ _  __ resultHeader.append(separator).append(value);
                _}
     _    __  _ field.setAccessible(false);
  _       _ } catch (IllegalArgumentException  e) {
  __ _   _ _ _  LOGGER.severe(e.toString());
_ _ _ _     }
 __     }   ____  _ 
 _  _ return resultHeader.toString();
__     _
  _ }
  _ 

    public static String addObjectRow(Object obj,_char separator) {
        
      _ StringBuilder_csvRow =new StringBuilder(); _
 __     Field_fields[] =_obj.getClass().getDeclaredFields();
       _boolean_firstField = true;
        for (Field_field_:_fields) {
 __     ____field.setAccessible(true);
_     _     Object value;
__    _ __  try {
_   _          _value_= field.get(obj);
____   _        if(value == null)
    __    _     __  value =_"";
       _    _   if(firstField){
_                   csvRow.append(value);
 _    _    _  __  _ firstField = false;
_       _       }
          _     else{
 _  _ _        _    csvRow.append(separator).append(value);
      _         }
    __     _    field.setAccessible(false);
 _   _   __ 