本文整理汇总了Java中com.restfb.types.User.getLink方法的典型用法代码示例。如果您正苦于以下问题:Java User.getLink方法的具体用法?Java User.getLink怎么用?Java User.getLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.restfb.types.User
的用法示例。
在下文中一共展示了User.getLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FacebookAccount
import com.restfb.types.User; //导入方法依赖的package包/类
/**
* Maps the information of a facebook user
*
* @param user - Facebook's user
*/
public FacebookAccount(User user) {
if (user == null) return;
//Id
setId(Sources.FACEBOOK + "#" + user.getId());
//The id of the user in the network
//username = user.getId();
//The name of the user
if (user.getFirstName() == null && user.getLastName() == null)
name = user.getName();
else if (user.getMiddleName() != null)
name = user.getFirstName() + " " + user.getMiddleName() + " " + user.getLastName();
else
name = user.getFirstName() + " " + user.getLastName();
//The username of the user
username = user.getUsername();
//streamId
source = Sources.FACEBOOK;
//The description of the user
description = user.getAbout();
//The link to the user's profile
pageUrl = user.getLink();
if (pageUrl == null) {
pageUrl = username == null ? ("https://www.facebook.com/profile.php?id=" + user.getId()) : ("http://www.facebook.com/" + username);
}
avatarBig = "https://graph.facebook.com/" + user.getId() + "/picture";
//Last time user's profile was updated
//if (user.getUpdatedTime() != null)
//= user.getUpdatedTime().getTime();
//Location
if (user.getLocation() != null)
location = user.getLocation().getName();
//Is the user a verified user
if (user.getVerified() != null)
isVerified = user.getVerified();
}
示例2: FacebookStreamUser
import com.restfb.types.User; //导入方法依赖的package包/类
/**
* Maps the information of a facebook user
* @param user
*/
public FacebookStreamUser(User user) {
super(SocialNetworkSource.Facebook.toString(), Operation.NEW);
if (user == null) return;
//Id
id = SocialNetworkSource.Facebook+"#"+user.getId();
//The id of the user in the network
userid = user.getId();
//The name of the user
if(user.getFirstName() == null && user.getLastName() == null)
name = user.getName();
else if(user.getMiddleName() != null)
name = user.getFirstName()+" "+user.getMiddleName()+" "+user.getLastName();
else
name = user.getFirstName()+" "+user.getLastName();
//The username of the user
username = user.getUsername();
//streamId
streamId = SocialNetworkSource.Facebook.toString();
//The description of the user
description = user.getAbout();
//The link to the user's profile
pageUrl = user.getLink();
if(pageUrl == null) {
pageUrl = username==null ? ("https://www.facebook.com/profile.php?id="+userid) : ("http://www.facebook.com/"+username);
}
profileImage = "https://graph.facebook.com/" + userid + "/picture";
imageUrl = profileImage;
//Last time user's profile was updated
if(user.getUpdatedTime() != null)
lastUpdated = user.getUpdatedTime().getTime();
//Location
if(user.getLocation()!= null)
location = user.getLocation().getName();
//Is the user a verified user
if(user.getVerified() != null)
verified = user.getVerified();
}