Hi all,
i have one arraylist say "templist" it will have items of item say "Stool"
now list contains duplicates
1 abc wwww.com lob1
1 abc wwww.com lob2
now i want like
1 abc wwww.com (lob1,lob2)
may be a separated list of lob's alone. how we can do it ? please help
List tempList = new ArrayList();
I added items of type ServiceItem
( which has property like id
,name
,url
,lob
)).
Like said i will duplicates for id
,name
,url
as these three can be mapped to different lobs
.
I want first three property to be one entry and last property should be list of differnt lobs
.
I made Changes to the code. now. Here is the code. Tell me how to achieve the result as 1 | ABC , BCA
public class ListTest {
public static void main(String args[]){
List TestList = new ArrayList();
MyBean myBean = new MyBean();
MyBean myBean2 = new MyBean();
myBean.setId("1");
myBean.setLob("ABC");
myBean2.setId("1");
myBean2.setLob("BCA");
TestList.add(myBean);
TestList.add(myBean2);
}
}
public class MyBean {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLob() {
return lob;
}
public void setLob(String lob) {
this.lob = lob;
}
private String lob;
}