spring mvc - Can not convert from object to list exception -


list<myjavaclass> smalllistnew = (list<myjavaclass>) i1.next(); 

above line causing error says object can not type casted type list<myjavaclass>.

below description code:

list<myjavaclass> i1=biglist.iterator(); 

big list contains many small list in following way:

//here unique list contains long values without duplicates being compared refreshjobcountlist. iterator<long> i=uniquerefjobid.iterator(); while (i.hasnext()) {     long refreshjobid = i.next();     list<myjavaclass> smalllist = new arraylist<>();      (myjavaclass details : refreshjobcountlist) {         if (refreshjobid.equals(details.getrefreshjobid())) {             myjavaclass new_obj=new myjavaclass();             new_obj.setcount(details.getcount());             new_obj.setjobrunid(details.getjobrunid());             new_obj.setrefreshjobid(details.getrefreshjobid());             smalllist.add(new_obj);         }     }      biglist.addall(smalllist);   } 


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -