List<VO>转成List<Map>

List <A01090021BatchAddCheckVO> list = (ArrayList <A01090021BatchAddCheckVO>) result.get ( "list" );
 IF (ValidateUtil.isEmpty (list)) { // upload was successful but the list is empty enter here 
     content setMsg ( "file you uploaded empty, please check and re-upload "," error "! ); 
     setSuccess ( false );
      return JSON; 
} 

List <the Map> succList = new new ArrayList ();    // return success 
List <the Map> errorlist = new new ArrayList ( );      // return a failure 


// the List <VO> converted to List <the Map> 
the Iterator <A01090021BatchAddCheckVO> Iterator = list.iterator ();
A01090021BatchAddCheckVO vo;
while (iterator.hasNext()){
        vo = iterator.next();
        succList.add(vo.toMap());
}

 

Guess you like

Origin www.cnblogs.com/moonsoft/p/11758064.html