I have a Arraylist
List<?> myList=new ArrayList();
myList = fetchQuery(); //fetches the list of Entities
Now myList Has a list of Entities
Now i convert that list to string,so it is a string object now.
String temp=myList.toString();
My question is how to convert that temp string again to that myList(List of entities) ???
Any ideas??
My Temp Value looks like this
temp=”[entityObject1,entityObject2…….]” ..
i could not extract each object and cast it with that entity class.. is there a way??
Thanks..
I have done a sample program to do this conversion.
Things you have to be careful about.
1.The class whose list with which we will be working should have an
over ridden toString method.(You can have your own toString() format
but need to change the rest of implementation accordingly).
Sample content Object Class with over ridden toString() method.
The Main Application.java