private void copyBusinessData(VCard card, Map<String, Object> contact) { for (Title title : card.getTitles()) { if (title.getValue() == null) { continue; } // This can loose data but there are only two title types in MS contacts if (title.getType() != null && title.getType().equalsIgnoreCase("home")) { safeSet("title", card.getTitles(), contact); } else { safeSet("jobTitle", card.getTitles(), contact); } } // This can loose data but there is only one company name in MS contacts for (Organization organization : card.getOrganizations()) { for (String orgName : organization.getValues()) { contact.put("companyName", orgName); } } for (Expertise expertise : card.getExpertise()) { if (expertise.getValue() == null) { continue; } contact.put("profession", expertise.getValue()); // only set first one break; } }
@Override public Title copy() { return new Title(this); } }
@Override protected Title _parseValue(String value) { return new Title(value); } }
/** * <p> * Adds a title associated with the person. * </p> * <p> * <b>Property name:</b> {@code TITLE}<br> * <b>Supported versions:</b> {@code 2.1, 3.0, 4.0} * </p> * @param title the title to add (e.g. "V.P. Research and Development") * @return the property object that was created * @see <a href="http://tools.ietf.org/html/rfc6350#page-39">RFC 6350 * p.39</a> * @see <a href="http://tools.ietf.org/html/rfc2426#page-17">RFC 2426 * p.17</a> * @see <a href="http://www.imc.org/pdi/vcard-21.doc">vCard 2.1 p.17</a> */ public Title addTitle(String title) { Title type = new Title(title); addTitle(type); return type; }