Class ClaimsSetRequest.Entry
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.claims.ClaimsSetRequest.Entry
-
- Enclosing class:
- ClaimsSetRequest
@Immutable public static class ClaimsSetRequest.Entry extends Object
Individual OpenID claim request.Related specifications:
- OpenID Connect Core 1.0, section 5.5.1.
- OpenID Connect for Identity Assurance 1.0.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,Object>getAdditionalInformation()Returns the additional information for the claim.StringgetClaimName()Returns the claim name.StringgetClaimName(boolean withLangTag)Returns the claim name, optionally with the language tag appended.ClaimRequirementgetClaimRequirement()Returns the claim requirement.com.nimbusds.langtag.LangTaggetLangTag()Returns the optional language tag for the claim.StringgetPurpose()Returns the optional purpose for which the claim is requested.ObjectgetRawValue()Returns the requested value (untyped) for the claim.StringgetValue()Deprecated.net.minidev.json.JSONObjectgetValueAsJSONObject()Returns the requested value (as JSON object) for the claim.NumbergetValueAsNumber()Returns the requested value (as number) for the claim.StringgetValueAsString()Returns the requested value (as string) for the claim.List<String>getValues()Deprecated.List<net.minidev.json.JSONObject>getValuesAsListOfJSONObjects()Returns the requested values (as JSON objects) for the claim.List<String>getValuesAsListOfStrings()Returns the requested values (as strings) for the claim.List<?>getValuesAsRawList()Returns the requested values (untyped) for the claim.static ClaimsSetRequest.Entryparse(Map.Entry<String,net.minidev.json.JSONObject> jsonObjectEntry)Parses an individual claim request from the specified JSON object entry.Map.Entry<String,net.minidev.json.JSONObject>toJSONObjectEntry()Returns the JSON object entry for this individual claim request.ClaimsSetRequest.EntrywithAdditionalInformation(Map<String,Object> additionalInformation)Sets additional information for the requested claim.ClaimsSetRequest.EntrywithClaimRequirement(ClaimRequirement requirement)Sets the claim requirement.ClaimsSetRequest.EntrywithLangTag(com.nimbusds.langtag.LangTag langTag)Sets the language tag for the claim.ClaimsSetRequest.EntrywithPurpose(String purpose)Sets the purpose for which the claim is requested.ClaimsSetRequest.EntrywithValue(Number value)Sets the requested value (as number) for the claim.ClaimsSetRequest.EntrywithValue(Object value)Sets the requested value (untyped) for the claim.ClaimsSetRequest.EntrywithValue(String value)Sets the requested value (as string) for the claim.ClaimsSetRequest.EntrywithValue(net.minidev.json.JSONObject value)Sets the requested value (as JSON object) for the claim.ClaimsSetRequest.EntrywithValues(List<?> values)Sets the requested values (untyped) for the claim.
-
-
-
Method Detail
-
getClaimName
public String getClaimName()
Returns the claim name.- Returns:
- The claim name.
-
getClaimName
public String getClaimName(boolean withLangTag)
Returns the claim name, optionally with the language tag appended.Example with language tag:
name#de-DE
- Parameters:
withLangTag- Iftruethe language tag will be appended to the name (if any), else not.- Returns:
- The claim name, with optionally appended language tag.
-
withClaimRequirement
public ClaimsSetRequest.Entry withClaimRequirement(ClaimRequirement requirement)
Sets the claim requirement.- Parameters:
requirement- The claim requirement. Must not benull,- Returns:
- The updated entry.
-
getClaimRequirement
public ClaimRequirement getClaimRequirement()
Returns the claim requirement.- Returns:
- The claim requirement.
-
withLangTag
public ClaimsSetRequest.Entry withLangTag(com.nimbusds.langtag.LangTag langTag)
Sets the language tag for the claim.- Parameters:
langTag- The language tag,nullif not specified.- Returns:
- The updated entry.
-
getLangTag
public com.nimbusds.langtag.LangTag getLangTag()
Returns the optional language tag for the claim.- Returns:
- The language tag,
nullif not specified.
-
withValue
public ClaimsSetRequest.Entry withValue(String value)
Sets the requested value (as string) for the claim.- Parameters:
value- The value,nullif not specified.- Returns:
- The updated entry.
-
withValue
public ClaimsSetRequest.Entry withValue(Number value)
Sets the requested value (as number) for the claim.- Parameters:
value- The value,nullif not specified.- Returns:
- The updated entry.
-
withValue
public ClaimsSetRequest.Entry withValue(net.minidev.json.JSONObject value)
Sets the requested value (as JSON object) for the claim.- Parameters:
value- The value,nullif not specified.- Returns:
- The updated entry.
-
withValue
public ClaimsSetRequest.Entry withValue(Object value)
Sets the requested value (untyped) for the claim.- Parameters:
value- The value,nullif not specified.- Returns:
- The updated entry.
-
getValueAsString
public String getValueAsString()
Returns the requested value (as string) for the claim.- Returns:
- The value as string,
nullif not specified or the value isn't a string.
-
getValue
@Deprecated public String getValue()
Deprecated.Returns the requested value (as string) for the claim. UsegetValueAsString()instead.- Returns:
- The value as string,
nullif not specified or the value isn't a string.
-
getValueAsNumber
public Number getValueAsNumber()
Returns the requested value (as number) for the claim.- Returns:
- The value as number,
nullif not specified or the value isn't a number.
-
getValueAsJSONObject
public net.minidev.json.JSONObject getValueAsJSONObject()
Returns the requested value (as JSON object) for the claim.- Returns:
- The value as JSON object,
nullif not specified or the value isn't a JSON object.
-
getRawValue
public Object getRawValue()
Returns the requested value (untyped) for the claim.- Returns:
- The value (untyped),
nullif not specified.
-
withValues
public ClaimsSetRequest.Entry withValues(List<?> values)
Sets the requested values (untyped) for the claim.- Parameters:
values- The values,nullif not specified.- Returns:
- The updated entry.
-
getValuesAsListOfStrings
public List<String> getValuesAsListOfStrings()
Returns the requested values (as strings) for the claim.- Returns:
- The values as list of strings,
nullif not specified or the values aren't strings.
-
getValues
@Deprecated public List<String> getValues()
Deprecated.Returns the requested values (as strings) for the claim. UsegetValuesAsListOfStrings()instead.- Returns:
- The values as list of strings,
nullif not specified or the values aren't strings.
-
getValuesAsListOfJSONObjects
public List<net.minidev.json.JSONObject> getValuesAsListOfJSONObjects()
Returns the requested values (as JSON objects) for the claim.- Returns:
- The values as list of JSON objects,
nullif not specified or the values aren't JSON objects.
-
getValuesAsRawList
public List<?> getValuesAsRawList()
Returns the requested values (untyped) for the claim.- Returns:
- The values as list of untyped objects,
nullif not specified.
-
withPurpose
public ClaimsSetRequest.Entry withPurpose(String purpose)
Sets the purpose for which the claim is requested.- Parameters:
purpose- The purpose,nullif not specified.- Returns:
- The updated entry.
-
getPurpose
public String getPurpose()
Returns the optional purpose for which the claim is requested.- Returns:
- The purpose,
nullif not specified.
-
withAdditionalInformation
public ClaimsSetRequest.Entry withAdditionalInformation(Map<String,Object> additionalInformation)
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,nullif not specified.- Returns:
- The updated entry.
-
getAdditionalInformation
public Map<String,Object> 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,
nullif not specified.
-
toJSONObjectEntry
public Map.Entry<String,net.minidev.json.JSONObject> 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 ParseException
Parses 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.
-
-