Set<CommunityMemberContactPojo> contacts = new HashSet<CommunityMemberContactPojo>();
Map<String, PersonContactPojo> pcp = p.getContacts();
Iterator<Map.Entry<String, PersonContactPojo>> it2 = pcp.entrySet().iterator();
while (it2.hasNext())
{
CommunityMemberContactPojo c = new CommunityMemberContactPojo();
Map.Entry<String, PersonContactPojo> pair = it2.next();
c.setType(pair.getKey().toString());
PersonContactPojo v = (PersonContactPojo)pair.getValue();
c.setValue(v.getValue());
contacts.add(c);
}
cmp.setContacts(contacts);
}
// Set links from person record
if (p.getLinks() != null)
{
// Set contacts from person record
Set<CommunityMemberLinkPojo> links = new HashSet<CommunityMemberLinkPojo>();
Map<String, PersonLinkPojo> plp = p.getLinks();
Iterator<Map.Entry<String, PersonLinkPojo>> it3 = plp.entrySet().iterator();
while (it.hasNext())
{
CommunityMemberLinkPojo c = new CommunityMemberLinkPojo();
Map.Entry<String, PersonLinkPojo> pair = it3.next();
c.setTitle(pair.getKey().toString());
PersonLinkPojo v = (PersonLinkPojo)pair.getValue();
c.setUrl(v.getUrl());
links.add(c);
}
cmp.setLinks(links);
}