当前位置: 首页>>代码示例>>Java>>正文


Java User.getUsername方法代码示例

本文整理汇总了Java中com.restfb.types.User.getUsername方法的典型用法代码示例。如果您正苦于以下问题:Java User.getUsername方法的具体用法?Java User.getUsername怎么用?Java User.getUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.restfb.types.User的用法示例。


在下文中一共展示了User.getUsername方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUserFromAPI

import com.restfb.types.User; //导入方法依赖的package包/类
@Deprecated
private FacebookProfile getUserFromAPI(String userN) {
	User auser = null;
	try {
		auser = apiConnection.fetchObject(userN, User.class);
		FacebookProfile fbp = new FacebookProfile(auser.getUsername(), auser.getId());
		fbp.setName(auser.getFirstName(), auser.getLastName());
		fbp.setLink(auser.getLink());
		fbp.setLocales(auser.getLocale());
		return fbp;
	} catch (FacebookException e) {
		// do nothing
	}
	return null;
}
 
开发者ID:fabiogermann,项目名称:zhaw-facepath,代码行数:16,代码来源:FacebookFacade.java

示例2: 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();


}
 
开发者ID:MKLab-ITI,项目名称:simmo,代码行数:55,代码来源:FacebookAccount.java

示例3: 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();
	
	
}
 
开发者ID:socialsensor,项目名称:socialmedia-abstractions,代码行数:56,代码来源:FacebookStreamUser.java


注:本文中的com.restfb.types.User.getUsername方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。