/** * Returns a Facebook profile picture url. * * @param id The id of the profile. * @param type The type of the picture. */ public static String getProfilePicture(String id, PROFILE_PICTURE_TYPE type) { String url = null; if (id != null && !id.isEmpty()) { url = "https://graph.facebook.com/" + id + "/picture?type=" + type.getValue(); } return url; }
public static PROFILE_PICTURE_TYPE fromString(String text) { if (text != null) { for (PROFILE_PICTURE_TYPE category : PROFILE_PICTURE_TYPE.values()) { if (text.equalsIgnoreCase(category.value)) { return category; } } } return null; }