public class UserInfo extends ClaimsSet
Example UserInfo claims set:
{ "sub" : "248289761001", "name" : "Jane Doe", "given_name" : "Jane", "family_name" : "Doe", "preferred_username" : "j.doe", "email" : "[email protected]", "picture" : "http://example.com/janedoe/me.jpg" }
Related specifications:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADDRESS_CLAIM_NAME
The address claim name.
|
static java.lang.String |
BIRTHDATE_CLAIM_NAME
The birth date claim name.
|
static java.lang.String |
EMAIL_CLAIM_NAME
The email claim name.
|
static java.lang.String |
EMAIL_VERIFIED_CLAIM_NAME
The email verified claim name.
|
static java.lang.String |
FAMILY_NAME_CLAIM_NAME
The family name claim name.
|
static java.lang.String |
GENDER_CLAIM_NAME
The gender claim name.
|
static java.lang.String |
GIVEN_NAME_CLAIM_NAME
The given name claim name.
|
static java.lang.String |
LOCALE_CLAIM_NAME
The locale claim name.
|
static java.lang.String |
MIDDLE_NAME_CLAIM_NAME
The middle name claim name.
|
static java.lang.String |
NAME_CLAIM_NAME
The name claim name.
|
static java.lang.String |
NICKNAME_CLAIM_NAME
The nickname claim name.
|
static java.lang.String |
PHONE_NUMBER_CLAIM_NAME
The phone number claim name.
|
static java.lang.String |
PHONE_NUMBER_VERIFIED_CLAIM_NAME
The phone number verified claim name.
|
static java.lang.String |
PICTURE_CLAIM_NAME
The picture claim name.
|
static java.lang.String |
PREFERRED_USERNAME_CLAIM_NAME
The preferred username claim name.
|
static java.lang.String |
PROFILE_CLAIM_NAME
The profile claim name.
|
static java.lang.String |
SUB_CLAIM_NAME
The subject claim name.
|
static java.lang.String |
UPDATED_AT_CLAIM_NAME
The updated at claim name.
|
static java.lang.String |
WEBSITE_CLAIM_NAME
The website claim name.
|
static java.lang.String |
ZONEINFO_CLAIM_NAME
The zoneinfo claim name.
|
Constructor and Description |
---|
UserInfo(net.minidev.json.JSONObject jsonObject)
Creates a new UserInfo claims set from the specified JSON object.
|
UserInfo(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
Creates a new UserInfo claims set from the specified JSON Web Token
(JWT) claims set.
|
UserInfo(Subject sub)
Creates a new minimal UserInfo claims set.
|
Modifier and Type | Method and Description |
---|---|
Address |
getAddress()
Gets the preferred address.
|
Address |
getAddress(com.nimbusds.langtag.LangTag langTag)
Gets the preferred address.
|
java.util.Map<com.nimbusds.langtag.LangTag,Address> |
getAddressEntries()
Gets the preferred address entries.
|
java.lang.String |
getBirthdate()
Gets the date of birth.
|
javax.mail.internet.InternetAddress |
getEmail()
Gets the preferred email address.
|
java.lang.Boolean |
getEmailVerified()
Gets the email verification status.
|
java.lang.String |
getFamilyName()
Gets the surname or last name.
|
java.lang.String |
getFamilyName(com.nimbusds.langtag.LangTag langTag)
Gets the surname or last name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getFamilyNameEntries()
Gets the surname or last name entries.
|
Gender |
getGender()
Gets the gender.
|
java.lang.String |
getGivenName()
Gets the given or first name.
|
java.lang.String |
getGivenName(com.nimbusds.langtag.LangTag langTag)
Gets the given or first name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getGivenNameEntries()
Gets the given or first name entries.
|
java.lang.String |
getLocale()
Gets the locale.
|
java.lang.String |
getMiddleName()
Gets the middle name.
|
java.lang.String |
getMiddleName(com.nimbusds.langtag.LangTag langTag)
Gets the middle name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getMiddleNameEntries()
Gets the middle name entries.
|
java.lang.String |
getName()
Gets the full name.
|
java.lang.String |
getName(com.nimbusds.langtag.LangTag langTag)
Gets the full name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getNameEntries()
Gets the full name entries.
|
java.lang.String |
getNickname()
Gets the casual name.
|
java.lang.String |
getNickname(com.nimbusds.langtag.LangTag langTag)
Gets the casual name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getNicknameEntries()
Gets the casual name entries.
|
java.lang.String |
getPhoneNumber()
Gets the preferred telephone number.
|
java.lang.Boolean |
getPhoneNumberVerified()
Gets the phone number verification status.
|
java.net.URI |
getPicture()
Gets the picture.
|
java.lang.String |
getPreferredUsername()
Gets the preferred username.
|
java.net.URI |
getProfile()
Gets the profile page.
|
static java.util.Set<java.lang.String> |
getStandardClaimNames()
Gets the names of the standard top-level UserInfo claims.
|
Subject |
getSubject()
Gets the UserInfo subject.
|
java.util.Date |
getUpdatedTime()
Gets the time the end-user information was last updated.
|
java.net.URI |
getWebsite()
Gets the web page or blog.
|
java.lang.String |
getZoneinfo()
Gets the zoneinfo.
|
static UserInfo |
parse(java.lang.String json)
Parses a UserInfo claims set from the specified JSON object string.
|
void |
putAll(UserInfo other)
Puts all claims from the specified other UserInfo claims set.
|
void |
setAddress(Address address)
Sets the preferred address.
|
void |
setAddress(Address address,
com.nimbusds.langtag.LangTag langTag)
Sets the preferred address.
|
void |
setBirthdate(java.lang.String birthdate)
Sets the date of birth.
|
void |
setEmail(javax.mail.internet.InternetAddress email)
Sets the preferred email address.
|
void |
setEmailVerified(java.lang.Boolean emailVerified)
Sets the email verification status.
|
void |
setFamilyName(java.lang.String familyName)
Sets the surname or last name.
|
void |
setFamilyName(java.lang.String familyName,
com.nimbusds.langtag.LangTag langTag)
Sets the surname or last name.
|
void |
setGender(Gender gender)
Sets the gender.
|
void |
setGivenName(java.lang.String givenName)
Sets the given or first name.
|
void |
setGivenName(java.lang.String givenName,
com.nimbusds.langtag.LangTag langTag)
Sets the given or first name.
|
void |
setLocale(java.lang.String locale)
Sets the locale.
|
void |
setMiddleName(java.lang.String middleName)
Sets the middle name.
|
void |
setMiddleName(java.lang.String middleName,
com.nimbusds.langtag.LangTag langTag)
Sets the middle name.
|
void |
setName(java.lang.String name)
Sets the full name.
|
void |
setName(java.lang.String name,
com.nimbusds.langtag.LangTag langTag)
Sets the full name.
|
void |
setNickname(java.lang.String nickname)
Sets the casual name.
|
void |
setNickname(java.lang.String nickname,
com.nimbusds.langtag.LangTag langTag)
Sets the casual name.
|
void |
setPhoneNumber(java.lang.String phoneNumber)
Sets the preferred telephone number.
|
void |
setPhoneNumberVerified(java.lang.Boolean phoneNumberVerified)
Sets the email verification status.
|
void |
setPicture(java.net.URI picture)
Sets the picture.
|
void |
setPreferredUsername(java.lang.String preferredUsername)
Sets the preferred username.
|
void |
setProfile(java.net.URI profile)
Sets the profile page.
|
void |
setUpdatedTime(java.util.Date updatedTime)
Sets the time the end-user information was last updated.
|
void |
setWebsite(java.net.URI website)
Sets the web page or blog.
|
void |
setZoneinfo(java.lang.String zoneinfo)
Sets the zoneinfo.
|
getBooleanClaim, getClaim, getClaim, getDateClaim, getEmailClaim, getLangTaggedClaim, getNumberClaim, getStringClaim, getStringClaim, getStringListClaim, getURIClaim, getURLClaim, putAll, setClaim, setClaim, setDateClaim, setEmailClaim, setURIClaim, setURLClaim, toJSONObject, toJWTClaimsSet
public static final java.lang.String SUB_CLAIM_NAME
public static final java.lang.String NAME_CLAIM_NAME
public static final java.lang.String GIVEN_NAME_CLAIM_NAME
public static final java.lang.String FAMILY_NAME_CLAIM_NAME
public static final java.lang.String MIDDLE_NAME_CLAIM_NAME
public static final java.lang.String NICKNAME_CLAIM_NAME
public static final java.lang.String PREFERRED_USERNAME_CLAIM_NAME
public static final java.lang.String PROFILE_CLAIM_NAME
public static final java.lang.String PICTURE_CLAIM_NAME
public static final java.lang.String WEBSITE_CLAIM_NAME
public static final java.lang.String EMAIL_CLAIM_NAME
public static final java.lang.String EMAIL_VERIFIED_CLAIM_NAME
public static final java.lang.String GENDER_CLAIM_NAME
public static final java.lang.String BIRTHDATE_CLAIM_NAME
public static final java.lang.String ZONEINFO_CLAIM_NAME
public static final java.lang.String LOCALE_CLAIM_NAME
public static final java.lang.String PHONE_NUMBER_CLAIM_NAME
public static final java.lang.String PHONE_NUMBER_VERIFIED_CLAIM_NAME
public static final java.lang.String ADDRESS_CLAIM_NAME
public static final java.lang.String UPDATED_AT_CLAIM_NAME
public UserInfo(Subject sub)
sub
- The subject. Must not be null
.public UserInfo(net.minidev.json.JSONObject jsonObject)
jsonObject
- The JSON object. Must not be null
.java.lang.IllegalArgumentException
- If the JSON object doesn't contain
a subject sub
string claim.public UserInfo(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
jwtClaimsSet
- The JWT claims set. Must not be null
.java.lang.IllegalArgumentException
- If the JWT claims set doesn't
contain a subject sub
string claim.public static java.util.Set<java.lang.String> getStandardClaimNames()
public void putAll(UserInfo other)
other
- The other UserInfo. Must have the same
subject
. Must not be null
.java.lang.IllegalArgumentException
- If the other UserInfo claims set
doesn't have an identical subject.public Subject getSubject()
sub
claim.public java.lang.String getName()
name
claim, with no
language tag.null
if not specified.public java.lang.String getName(com.nimbusds.langtag.LangTag langTag)
name
claim, with an
optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getNameEntries()
name
claim.public void setName(java.lang.String name)
name
claim, with no
language tag.name
- The full name. If null
the claim will be
removed.public void setName(java.lang.String name, com.nimbusds.langtag.LangTag langTag)
name
claim, with an
optional language tag.name
- The full name. If null
the claim will be
removed.langTag
- The language tag, null
if not specified.public java.lang.String getGivenName()
given_name
claim, with no language tag.null
if not specified.public java.lang.String getGivenName(com.nimbusds.langtag.LangTag langTag)
given_name
claim, with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getGivenNameEntries()
given_name
claim.public void setGivenName(java.lang.String givenName)
given_name
claim, with no language tag.givenName
- The given or first name. If null
the claim
will be removed.public void setGivenName(java.lang.String givenName, com.nimbusds.langtag.LangTag langTag)
given_name
claim, with an optional language tag.givenName
- The given or first full name. If null
the
claim will be removed.langTag
- The language tag, null
if not specified.public java.lang.String getFamilyName()
family_name
claim, with no language tag.null
if not specified.public java.lang.String getFamilyName(com.nimbusds.langtag.LangTag langTag)
family_name
claim, with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getFamilyNameEntries()
public void setFamilyName(java.lang.String familyName)
family_name
claim, with no language tag.familyName
- The surname or last name. If null
the
claim will be removed.public void setFamilyName(java.lang.String familyName, com.nimbusds.langtag.LangTag langTag)
family_name
claim, with an optional language tag.familyName
- The surname or last name. If null
the
claim will be removed.langTag
- The language tag, null
if not specified.public java.lang.String getMiddleName()
middle_name
claim,
with no language tag.null
if not specified.public java.lang.String getMiddleName(com.nimbusds.langtag.LangTag langTag)
middle_name
claim,
with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getMiddleNameEntries()
middle_name
claim.public void setMiddleName(java.lang.String middleName)
middle_name
claim,
with no language tag.middleName
- The middle name. If null
the claim will be
removed.public void setMiddleName(java.lang.String middleName, com.nimbusds.langtag.LangTag langTag)
middle_name
claim,
with an optional language tag.middleName
- The middle name. If null
the claim will be
removed.langTag
- The language tag, null
if not specified.public java.lang.String getNickname()
nickname
claim,
with no language tag.null
if not specified.public java.lang.String getNickname(com.nimbusds.langtag.LangTag langTag)
nickname
claim,
with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getNicknameEntries()
nickname
claim.public void setNickname(java.lang.String nickname)
nickname
claim,
with no language tag.nickname
- The casual name. If null
the claim will be
removed.public void setNickname(java.lang.String nickname, com.nimbusds.langtag.LangTag langTag)
nickname
claim,
with an optional language tag.nickname
- The casual name. If null
the claim will be
removed.langTag
- The language tag, null
if not specified.public java.lang.String getPreferredUsername()
preferred_username
claim.null
if not specified.public void setPreferredUsername(java.lang.String preferredUsername)
preferred_username
claim.preferredUsername
- The preferred username. If null
the
claim will be removed.public java.net.URI getProfile()
profile
claim.null
if not specified.public void setProfile(java.net.URI profile)
profile
claim.profile
- The profile page URI. If null
the claim will
be removed.public java.net.URI getPicture()
picture
claim.null
if not specified.public void setPicture(java.net.URI picture)
picture
claim.picture
- The picture URI. If null
the claim will be
removed.public java.net.URI getWebsite()
website
claim.null
if not specified.public void setWebsite(java.net.URI website)
website
claim.website
- The web page or blog URI. If null
the claim
will be removed.public javax.mail.internet.InternetAddress getEmail()
email
claim.null
if not specified.public void setEmail(javax.mail.internet.InternetAddress email)
email
claim.email
- The preferred email address. If null
the claim
will be removed.public java.lang.Boolean getEmailVerified()
email_verified
claim.null
if not
specified.public void setEmailVerified(java.lang.Boolean emailVerified)
email_verified
claim.emailVerified
- The email verification status. If null
the claim will be removed.public Gender getGender()
gender
claim.null
if not specified.public void setGender(Gender gender)
gender
claim.gender
- The gender. If null
the claim will be removed.public java.lang.String getBirthdate()
birthdate
claim.null
if not specified.public void setBirthdate(java.lang.String birthdate)
birthdate
claim.birthdate
- The date of birth. If null
the claim will
be removed.public java.lang.String getZoneinfo()
zoneinfo
claim.null
if not specified.public void setZoneinfo(java.lang.String zoneinfo)
zoneinfo
claim.zoneinfo
- The zoneinfo. If null
the claim will be
removed.public java.lang.String getLocale()
locale
claim.null
if not specified.public void setLocale(java.lang.String locale)
locale
claim.locale
- The locale. If null
the claim will be
removed.public java.lang.String getPhoneNumber()
phone_number
claim.null
if not
specified.public void setPhoneNumber(java.lang.String phoneNumber)
phone_number
claim.phoneNumber
- The preferred telephone number. If null
the claim will be removed.public java.lang.Boolean getPhoneNumberVerified()
phone_number_verified
claim.null
if not
specified.public void setPhoneNumberVerified(java.lang.Boolean phoneNumberVerified)
phone_number_verified
claim.phoneNumberVerified
- The phone number verification status. If
null
the claim will be removed.public Address getAddress()
address
claim, with no language tag.null
if not specified.public Address getAddress(com.nimbusds.langtag.LangTag langTag)
address
claim, with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,Address> getAddressEntries()
address
claim.public void setAddress(Address address)
address
claim, with no language tag.address
- The preferred address. If null
the claim will
be removed.public void setAddress(Address address, com.nimbusds.langtag.LangTag langTag)
address
claim, with an optional language tag.address
- The preferred address. If null
the claim
will be removed.langTag
- The language tag, null
if not specified.public java.util.Date getUpdatedTime()
updated_at
claim.null
if not specified.public void setUpdatedTime(java.util.Date updatedTime)
updated_at
claim.updatedTime
- The time the end-user information was last
updated. If null
the claim will be
removed.public static UserInfo parse(java.lang.String json) throws ParseException
json
- The JSON object string to parse. Must not be
null
.ParseException
- If parsing failed.Copyright © 2014 Connect2id Ltd.. All Rights Reserved.