Class ClaimsSetRequest.Entry
java.lang.Object
com.nimbusds.openid.connect.sdk.claims.ClaimsSetRequest.Entry
- Enclosing class:
- ClaimsSetRequest
Individual OpenID claim request.
Related specifications:
- OpenID Connect Core 1.0
- OpenID Connect for Identity Assurance 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the additional information for the claim.Returns the claim name.getClaimName
(boolean withLangTag) Returns the claim name, optionally with the language tag appended.Returns the claim requirement.com.nimbusds.langtag.LangTag
Returns the optional language tag for the claim.Returns the optional purpose for which the claim is requested.Returns the requested value (untyped) for the claim.getValue()
Deprecated.net.minidev.json.JSONObject
Returns the requested value (as JSON object) for the claim.Returns the requested value (as number) for the claim.Returns the requested value (as string) for the claim.Deprecated.List<net.minidev.json.JSONObject>
Returns the requested values (as JSON objects) for the claim.Returns the requested values (as strings) for the claim.List<?>
Returns the requested values (untyped) for the claim.static ClaimsSetRequest.Entry
Parses an individual claim request from the specified JSON object entry.Returns the JSON object entry for this individual claim request.withAdditionalInformation
(Map<String, Object> additionalInformation) Sets additional information for the requested claim.withClaimRequirement
(ClaimRequirement requirement) Sets the claim requirement.withLangTag
(com.nimbusds.langtag.LangTag langTag) Sets the language tag for the claim.withPurpose
(String purpose) Sets the purpose for which the claim is requested.Sets the requested value (as number) for the claim.Sets the requested value (untyped) for the claim.Sets the requested value (as string) for the claim.withValue
(net.minidev.json.JSONObject value) Sets the requested value (as JSON object) for the claim.withValues
(List<?> values) Sets the requested values (untyped) for the claim.
-
Constructor Details
-
Entry
Creates a new individual claim request. The claim requirement is set tovoluntary
(the default) and no expected value(s) or other parameters are specified.- Parameters:
claimName
- The claim name. Must not benull
.
-
-
Method Details
-
getClaimName
Returns the claim name.- Returns:
- The claim name.
-
getClaimName
Returns the claim name, optionally with the language tag appended.Example with language tag:
name#de-DE
- Parameters:
withLangTag
- Iftrue
the language tag will be appended to the name (if any), else not.- Returns:
- The claim name, with optionally appended language tag.
-
withClaimRequirement
Sets the claim requirement.- Parameters:
requirement
- The claim requirement. Must not benull
,- Returns:
- The updated entry.
-
getClaimRequirement
Returns the claim requirement.- Returns:
- The claim requirement.
-
withLangTag
Sets the language tag for the claim.- Parameters:
langTag
- The language tag,null
if not specified.- Returns:
- The updated entry.
-
getLangTag
Returns the optional language tag for the claim.- Returns:
- The language tag,
null
if not specified.
-
withValue
Sets the requested value (as string) for the claim.- Parameters:
value
- The value,null
if not specified.- Returns:
- The updated entry.
-
withValue
Sets the requested value (as number) for the claim.- Parameters:
value
- The value,null
if not specified.- Returns:
- The updated entry.
-
withValue
Sets the requested value (as JSON object) for the claim.- Parameters:
value
- The value,null
if not specified.- Returns:
- The updated entry.
-
withValue
Sets the requested value (untyped) for the claim.- Parameters:
value
- The value,null
if not specified.- Returns:
- The updated entry.
-
getValueAsString
Returns the requested value (as string) for the claim.- Returns:
- The value as string,
null
if not specified or the value isn't a string.
-
getValue
Deprecated.Returns the requested value (as string) for the claim. UsegetValueAsString()
instead.- Returns:
- The value as string,
null
if not specified or the value isn't a string.
-
getValueAsNumber
Returns the requested value (as number) for the claim.- Returns:
- The value as number,
null
if not specified or the value isn't a number.
-
getValueAsJSONObject
Returns the requested value (as JSON object) for the claim.- Returns:
- The value as JSON object,
null
if not specified or the value isn't a JSON object.
-
getRawValue
Returns the requested value (untyped) for the claim.- Returns:
- The value (untyped),
null
if not specified.
-
withValues
Sets the requested values (untyped) for the claim.- Parameters:
values
- The values,null
if not specified.- Returns:
- The updated entry.
-
getValuesAsListOfStrings
Returns the requested values (as strings) for the claim.- Returns:
- The values as list of strings,
null
if not specified or the values aren't strings.
-
getValues
Deprecated.Returns the requested values (as strings) for the claim. UsegetValuesAsListOfStrings()
instead.- Returns:
- The values as list of strings,
null
if not specified or the values aren't strings.
-
getValuesAsListOfJSONObjects
Returns the requested values (as JSON objects) for the claim.- Returns:
- The values as list of JSON objects,
null
if not specified or the values aren't JSON objects.
-
getValuesAsRawList
Returns the requested values (untyped) for the claim.- Returns:
- The values as list of untyped objects,
null
if not specified.
-
withPurpose
Sets the purpose for which the claim is requested.- Parameters:
purpose
- The purpose,null
if not specified.- Returns:
- The updated entry.
-
getPurpose
Returns the optional purpose for which the claim is requested.- Returns:
- The purpose,
null
if not specified.
-
withAdditionalInformation
Sets additional information for the requested claim.Example additional information in the "info" member:
{ "userinfo" : { "email": null, "email_verified": null, "http://example.info/claims/groups" : { "info" : "custom information" } } }
- Parameters:
additionalInformation
- The additional information,null
if not specified.- Returns:
- The updated entry.
-
getAdditionalInformation
Returns the additional information for the claim.Example additional information in the "info" member:
{ "userinfo" : { "email": null, "email_verified": null, "http://example.info/claims/groups" : { "info" : "custom information" } } }
- Returns:
- The additional information,
null
if not specified.
-
toJSONObjectEntry
Returns the JSON object entry for this individual claim request.- Returns:
- The JSON object entry.
-
parse
public static ClaimsSetRequest.Entry parse(Map.Entry<String, net.minidev.json.JSONObject> jsonObjectEntry) throws ParseExceptionParses an individual claim request from the specified JSON object entry.- Parameters:
jsonObjectEntry
- The JSON object entry to parse. Must not benull
.- Returns:
- The individual claim request.
- Throws:
ParseException
- If parsing failed.
-