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


Java Person.getDisplayName方法代码示例

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


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

示例1: updateUserInformation

import com.google.api.services.plus.model.Person; //导入方法依赖的package包/类
/**
 * Updates current Tech Gallery user information with user data found on
 * Google.
 *
 * @param user
 *          Google user
 * @param person
 *          Google Plus person information
 * @param tgUser
 *          Tech Gallery user
 */
private void updateUserInformation(final User user, Person person, TechGalleryUser tgUser) {
  String plusEmail = user.getEmail();
  String plusPhoto = person.getImage().getUrl();
  String plusName = person.getDisplayName();

  String currentEmail = tgUser.getEmail();
  String currentPhoto = tgUser.getPhoto();
  String currentName = tgUser.getName();

  if (currentEmail == null || !currentEmail.equals(plusEmail)) {
    tgUser.setEmail(plusEmail);
  }
  if (currentPhoto == null || !currentPhoto.equals(plusPhoto)) {
    tgUser.setPhoto(plusPhoto);
  }
  if (currentName == null || !currentName.equals(plusName)) {
    tgUser.setName(plusName);
  }
  if (tgUser.getGoogleId() == null) {
    tgUser.setGoogleId(user.getUserId());
  }
}
 
开发者ID:ciandt-dev,项目名称:tech-gallery,代码行数:34,代码来源:UserServiceTGImpl.java

示例2: GooglePlusStreamUser

import com.google.api.services.plus.model.Person; //导入方法依赖的package包/类
public GooglePlusStreamUser(Person person) {
	super(SocialNetworkSource.GooglePlus.toString(), Operation.NEW);
	if (person == null) 
		return;
	
	//Id
	id = SocialNetworkSource.GooglePlus + "#"+person.getId();
	
	//The id of the user in the network
	userid = person.getId();
	
	//The name of the user
	name = person.getDisplayName();
	
	//The username of the user
	username = person.getDisplayName();
	
	//The brief description of this person.
	description = person.getTagline();
	
	//streamId
	streamId = SocialNetworkSource.GooglePlus.toString();
	
	//Profile picture of the user
	profileImage = person.getImage().getUrl();
	imageUrl = profileImage;
	
	//The link to the user's profile
	pageUrl =  person.getUrl();
	
	verified = person.getVerified();
	
	if(person.getCircledByCount() != null)
		followers = (long) person.getCircledByCount();
	
	location = person.getCurrentLocation();

}
 
开发者ID:socialsensor,项目名称:socialmedia-abstractions,代码行数:39,代码来源:GooglePlusStreamUser.java

示例3: GooglePlusAccount

import com.google.api.services.plus.model.Person; //导入方法依赖的package包/类
public GooglePlusAccount(Person person) {

        if (person == null)
            return;

        //Id
        setId(Sources.GOOGLE_PLUS + "#" + person.getId());

        userId = person.getId();
        
        //The id of the user in the network
        username = person.getId();

        //The name of the user
        name = person.getDisplayName();

        //The username of the user
        username = person.getDisplayName();

        //The brief description of this person.
        description = person.getTagline();

        //streamId
        source = Sources.GOOGLE_PLUS;

        //Profile picture of the user
        avatarBig = person.getImage().getUrl();

        //The link to the user's profile
        pageUrl = person.getUrl();

        isVerified = person.getVerified();

        if (person.getCircledByCount() != null)
            numFollowers = person.getCircledByCount();

        location = person.getCurrentLocation();

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


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