It din't help me. Sorry let me clarify my problem to you.
My code is
selectedSeatNos = StringUtil.split(bookingsForm.getSeatNos(), AppConstants.COMMA);
results=Arrays.asList(selectedSeatNos);
List<SeatsBlocking> seatNos= new ArrayList<SeatsBlocking>(results);
blocking.setSeatNos(results.toString());
bookingsForm.setSeatRecords(seatNos);
here the results is a array list which i need to set to a list of type SeatsBlocking.
This is where actually i am getting error... Please let me know if there is a problem in my code..
List<SeatsBlocking> seatNos= new ArrayList<SeatsBlocking>(results);
You can't do that. SeatsBlocking and String are two different types and I assume there is no relationship between them. Both your lists, results as well as seatNos are already typified as String list and SeatsBlocking list so Java's strong type checking wont allow that.
srikanth sridhar
Greenhorn
Joined: Dec 17, 2011
Posts: 15
posted
0
Hi Barney,
yes you are right. But is there any solution to it.?
It will be a great help..
Praveen Kumar M K
Ranch Hand
Joined: Jul 03, 2011
Posts: 256
posted
0
Ok so you have a String list called results from which you want to make a list of SeatsBlocking. Why don't you loop through results and create as many SeatsBlocking objects as there are in results list. Probably you can assign each element of result into a member within SeatsBlocking instance.
srikanth sridhar
Greenhorn
Joined: Dec 17, 2011
Posts: 15
posted
0
barney,
I tried as you said. But i am not able to create the objects as you said.