本文整理汇总了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());
}
}
示例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();
}
示例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();
}