org.scribe.up.profile.yahoo.YahooProfile类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.scribe.up.profile.yahoo.YahooProfile类的一些代码示例,展示了YahooProfile类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YahooProfile类的具体详情如下:
包路径:org.scribe.up.profile.yahoo.YahooProfile
类名称:YahooProfile

YahooProfile介绍

[英]This class is the user profile for Yahoo with appropriate getters.
It is returned by the org.scribe.up.provider.impl.YahooProvider.

Method :From the JSON profile response :The attributes of the org.scribe.up.profile.CommonProfileString getEmail()the primary (or only one) email from the emails attributeString getFirstName()the given_name attributeString getFamilyName()the family_name attributeString getDisplayName()the given_name attribute followed by a space and the family_name attributeString getUsername()the nickname attributeGender getGender()the gender attributeLocale getLocale()the lang attributeString getPictureUrl()the imageUrl sub-attribute from the image attributeString getProfileUrl()the profile_url attributeString getLocation()the location attributeMore specific attributesString getAboutMe()the aboutMe attributeList<YahooAddress> getAddresses()the addresses attributeInteger getBirthYear()the birthYear attributeDate getBirthdate()the birthdate attributeDate getCreated()the created attributeInteger getDisplayAge()the displayAge attributeList<YahooDisclosure> getDisclosures()the disclosures attributeList<YahooEmail> getEmails()the emails attributeYahooImage getImage()the image attributeList<YahooInterest> getInterests()the interests attributeBoolean getIsConnected()the isConnected attributeDate getMemberSince()the memberSince attributeString getTimeZone()the timeZone attributeDate getUpdated()the updated attributeString getUri()the uri attribute
[中]这个类是Yahoo的用户配置文件,带有适当的getter。
它由组织返回。抄写员向上的供应商。impl。YahooProvider。
方法:来自JSON概要文件响应:组织的属性。抄写员向上的轮廓CommonProfileString getEmail()来自电子邮件的主要(或仅一封)电子邮件attributeString getFirstName()给定的_nameattributeString getFamilyName()家庭_nameattributeString getDisplayName()给定的_name属性后跟空格和家庭_nameattributeString getUsername()昵称attributeGender getGender()性别attributeLocale()lang attributeString getPictureUrl()来自图像attributeString getProfileUrl()的imageUrl子属性profile_url attributeString getLocation()位置属性更具体的属性String getAboutMe()aboutMe属性列表<YahooAddress>getAddresses()地址属性Integer getBirthYear()生日属性Date getBirthdate()生日属性Date getCreated()创建的属性Integer getDisplayAge()displayAge属性列表<YahooDisclosure>GetDisclosure()披露属性列表<YahooEmail>getEmails()电子邮件属性AhooiImage getImage()图像属性列表<YahooInterest>getInterests()兴趣attributebolean getIsConnected()isConnected attributeDate getMemberSince()membersing attributeString getTimeZone()时区attributeDate getUpdated()更新的attributeString getUri()uri属性

代码示例

代码示例来源:origin: org.scribe/scribe-up

public String getAboutMe() {
  return (String) get(YahooAttributesDefinition.ABOUT_ME);
}

代码示例来源:origin: org.scribe/scribe-up

final YahooProfile profile = (YahooProfile) userProfile;
logger.debug("userProfile : {}", profile);
assertEquals("PCSXZCYSWC6XUJNMZKRGWVPHNU", profile.getId());
assertEquals(YahooProfile.class.getSimpleName() + UserProfile.SEPARATOR + "PCSXZCYSWC6XUJNMZKRGWVPHNU",
       profile.getTypedId());
assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), YahooProfile.class));
assertCommonProfile(userProfile, "testscribeup@yahoo.fr", "Test", "ScribeUP", "Test ScribeUP", "Test",
          Gender.MALE, Locale.FRANCE,
          "http://avatars.zenfs.com/users/1DJGkdA6uAAECQWEo8AceAQ==.large.png",
          "http://profile.yahoo.com/PCSXZCYSWC6XUJNMZKRGWVPHNU", "Chatou, Ile-de-France");
assertEquals("my profile", profile.getAboutMe());
final List<YahooAddress> addresses = profile.getAddresses();
assertEquals(2, addresses.size());
final YahooAddress address = addresses.get(0);
assertEquals("", address.getStreet());
assertEquals("HOME", address.getType());
assertEquals(1976, profile.getBirthYear().intValue());
assertEquals("03/10", profile.getBirthdate().toString());
assertEquals("2012-02-06T12:46:43Z", profile.getCreated().toString());
assertEquals(36, profile.getDisplayAge().intValue());
final List<YahooDisclosure> disclosures = profile.getDisclosures();
assertEquals(2, disclosures.size());
final YahooDisclosure disclosure = disclosures.get(0);
assertTrue(disclosure.getSeen() instanceof Date);
assertEquals("1", disclosure.getVersion());
final List<YahooEmail> emails = profile.getEmails();
assertEquals(2, emails.size());

代码示例来源:origin: org.scribe/scribe-up

@Override
  protected UserProfile extractUserProfile(final String body) {
    final YahooProfile profile = new YahooProfile();
    JsonNode json = JsonHelper.getFirstNode(body);
    if (json != null) {
      json = json.get("profile");
      if (json != null) {
        profile.setId(JsonHelper.get(json, "guid"));
        for (final String attribute : OAuthAttributesDefinitions.yahooDefinition.getAllAttributes()) {
          profile.addAttribute(attribute, JsonHelper.get(json, attribute));
        }
      }
    }
    return profile;
  }
}

代码示例来源:origin: org.scribe/scribe-up

public String getEmail() {
  final List<YahooEmail> emails = getEmails();
  if (emails != null) {
    for (final YahooEmail email : emails) {
      if (email != null && ((email.getPrimary() != null && email.getPrimary()) || emails.size() == 1)) {
        return email.getHandle();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.scribe/scribe-up

public List<YahooDisclosure> getDisclosures() {
  return (List<YahooDisclosure>) get(YahooAttributesDefinition.DISCLOSURES);
}

代码示例来源:origin: org.scribe/scribe-up

public Date getUpdated() {
  return (Date) get(YahooAttributesDefinition.UPDATED);
}

代码示例来源:origin: org.scribe/scribe-up

public String getFirstName() {
  return (String) get(YahooAttributesDefinition.GIVEN_NAME);
}

代码示例来源:origin: org.scribe/scribe-up

public String getFamilyName() {
  return (String) get(YahooAttributesDefinition.FAMILY_NAME);
}

代码示例来源:origin: org.scribe/scribe-up

public Integer getBirthYear() {
  return (Integer) get(YahooAttributesDefinition.BIRTH_YEAR);
}

代码示例来源:origin: org.scribe/scribe-up

public String getTimeZone() {
  return (String) get(YahooAttributesDefinition.TIME_ZONE);
}

代码示例来源:origin: org.scribe/scribe-up

public String getUsername() {
  return (String) get(YahooAttributesDefinition.NICKNAME);
}

代码示例来源:origin: org.scribe/scribe-up

public Gender getGender() {
  return (Gender) get(YahooAttributesDefinition.GENDER);
}

代码示例来源:origin: org.scribe/scribe-up

public String getLocation() {
  return (String) get(YahooAttributesDefinition.LOCATION);
}

代码示例来源:origin: org.scribe/scribe-up

public List<YahooEmail> getEmails() {
  return (List<YahooEmail>) get(YahooAttributesDefinition.EMAILS);
}

代码示例来源:origin: org.scribe/scribe-up

public List<YahooAddress> getAddresses() {
  return (List<YahooAddress>) get(YahooAttributesDefinition.ADDRESSES);
}

代码示例来源:origin: org.scribe/scribe-up

public Date getCreated() {
  return (Date) get(YahooAttributesDefinition.CREATED);
}

代码示例来源:origin: org.scribe/scribe-up

public Integer getDisplayAge() {
  return (Integer) get(YahooAttributesDefinition.DISPLAY_AGE);
}

代码示例来源:origin: org.scribe/scribe-up

public Date getMemberSince() {
  return (Date) get(YahooAttributesDefinition.MEMBER_SINCE);
}

代码示例来源:origin: org.scribe/scribe-up

public String getUri() {
    return (String) get(YahooAttributesDefinition.URI);
  }
}

代码示例来源:origin: org.scribe/scribe-up

public Locale getLocale() {
  return (Locale) get(YahooAttributesDefinition.LANG);
}

相关文章

YahooProfile类方法