for (Map.Entry<ContactMethod, ContactMethodDetail> entry : user.getContactMethodMap().entrySet()) {
String propertyName = entry.getKey().getPropertyNameSingular();
ContactMethodDetail contactMethodDetail = entry.getValue();
String primaryDetail = contactMethodDetail.getPrimaryDetail();
representation.withProperty(propertyName, primaryDetail);
// Determine if secondary details should be included
if (entry.getKey().isSecondaryDetailSupported()) {
Set<String> secondaryDetails = contactMethodDetail.getSecondaryDetails();
// TODO Consider if a 1-based field index is the best representation here: array? sub-resource?