|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.openid.connect.sdk.claims.ClaimsSet
public abstract class ClaimsSet
Claims set serialisable to a JSON object.
Constructor Summary | |
---|---|
protected |
ClaimsSet()
Creates a new empty claims set. |
protected |
ClaimsSet(net.minidev.json.JSONObject jsonObject)
Creates a new claims set from the specified JSON object. |
Method Summary | ||
---|---|---|
Boolean |
getBooleanClaim(String name)
Gets a boolean-based claim. |
|
Object |
getClaim(String name)
Gets a claim. |
|
|
getClaim(String name,
Class<T> clazz)
Gets a claim that casts to the specified class. |
|
Date |
getDateClaim(String name)
Gets a date / time based claim, represented as the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date / time. |
|
javax.mail.internet.InternetAddress |
getEmailClaim(String name)
Gets an email string based claim. |
|
net.minidev.json.JSONObject |
getJSONObject()
Gets the JSON object representation of this claims set. |
|
|
getLangTaggedClaim(String name,
Class<T> clazz)
Returns a map of all instances, including language-tagged, of a claim with the specified base name. |
|
Number |
getNumberClaim(String name)
Gets a number-based claim. |
|
String |
getStringClaim(String name)
Gets a string-based claim. |
|
String |
getStringClaim(String name,
com.nimbusds.langtag.LangTag langTag)
Gets a string-based claim with an optional language tag. |
|
URL |
getURLClaim(String name)
Gets an URL string based claim. |
|
void |
setClaim(String name,
Object value)
Sets a claim. |
|
|
setClaim(String name,
Object value,
com.nimbusds.langtag.LangTag langTag)
Sets a claim with an optional language tag. |
|
void |
setDateClaim(String name,
Date value)
Sets a date / time based claim, represented as the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date / time. |
|
void |
setEmailClaim(String name,
javax.mail.internet.InternetAddress value)
Sets an email string based claim. |
|
void |
setURLClaim(String name,
URL value)
Sets an URL string based claim. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ClaimsSet()
protected ClaimsSet(net.minidev.json.JSONObject jsonObject)
jsonObject
- The JSON object. Must not be null
.Method Detail |
---|
public Object getClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified.public <T> T getClaim(String name, Class<T> clazz)
name
- The claim name. Must not be null
.clazz
- The Java class that the claim value should cast to.
Must not be null
.
null
if not specified or casting
failed.public <T> Map<com.nimbusds.langtag.LangTag,T> getLangTaggedClaim(String name, Class<T> clazz)
Example JSON serialised claims set:
{ "month" : "January", "month#de" : "Januar" "month#es" : "enero", "month#it" : "gennaio" }
The "month" claim instances as java.util.Map:
null => "January" (no language tag) "de" => "Januar" "es" => "enero" "it" => "gennaio"
name
- The claim name. Must not be null
.clazz
- The Java class that the claim values should cast to.
Must not be null
.
null
key indicates the value has no language
tag (corresponds to the base name).public void setClaim(String name, Object value)
name
- The claim name, with an optional language tag. Must not
be null
.value
- The claim value. Should serialise to a JSON entity. If
null
any existing claim with the same name will
be removed.public <T> void setClaim(String name, Object value, com.nimbusds.langtag.LangTag langTag)
name
- The claim name. Must not be null
.value
- The claim value. Should serialise to a JSON entity.
If null
any existing claim with the same name
and language tag (if any) will be removed.langTag
- The language tag of the claim value, null
if
not tagged.public String getStringClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or casting
failed.public String getStringClaim(String name, com.nimbusds.langtag.LangTag langTag)
name
- The claim name. Must not be null
.langTag
- The language tag of the claim value, null
to
get the non-tagged value.
null
if not specified or casting
failed.public Boolean getBooleanClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or casting
failed.public Number getNumberClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or casting
failed.public URL getURLClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or parsing
failed.public void setURLClaim(String name, URL value)
name
- The claim name. Must not be null
.value
- The claim value. If null
any existing claim
with the same name will be removed.public javax.mail.internet.InternetAddress getEmailClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or parsing
failed.public void setEmailClaim(String name, javax.mail.internet.InternetAddress value)
name
- The claim name. Must not be null
.value
- The claim value. If null
any existing claim
with the same name will be removed.public Date getDateClaim(String name)
name
- The claim name. Must not be null
.
null
if not specified or parsing
failed.public void setDateClaim(String name, Date value)
name
- The claim name. Must not be null
.value
- The claim value. If null
any existing claim
with the same name will be removed.public net.minidev.json.JSONObject getJSONObject()
Example:
{ "country" : "USA", "country#en" : "USA", "country#de_DE" : "Vereinigte Staaten", "country#fr_FR" : "Etats Unis" }
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |