public class ClaimsConstraint extends LinkedHashMap<String,VerifiedClaimConstraint> implements Constraint
verified_claims/claims.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
ClaimsConstraint() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Check if the key that represents the constraint exists.
|
static ClaimsConstraint |
extract(Map<?,?> map,
String key)
Create a
ClaimsConstraint instance from an object in the given map. |
boolean |
isNull()
Check if the value of the constraint is null.
|
ClaimsConstraint |
putClaim(String claimName,
VerifiedClaimConstraint constraint)
Put a claim constraint to this object.
|
void |
setExists(boolean exists)
Set the existence of the constraint.
|
void |
setNull(boolean isNull)
Set the boolean flag that indicates that the value of the constraint is null.
|
String |
toJson()
Convert this object into JSON in the way conforming to the structure
defined in 5.
|
String |
toJson(boolean pretty)
Convert this object into JSON in the way conforming to the structure
defined in 5.
|
Map<String,Object> |
toMap()
Create a
Map instance that represents this object in the way
conforming to the structure defined in 5. |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic boolean exists()
Constraint
For example, exists() method of an instance that represents
given_name in the JSON below will return true.
{
"verified_claims": {
"claims": {
"given_name": null
}
}
}
exists in interface Constrainttrue if the key that represents the constraint exists.public void setExists(boolean exists)
exists - true to indicate that the constraint exists.public boolean isNull()
Constraint
For example, isNull() method of an instance that represents
given_name in the JSON below will return true.
{
"verified_claims": {
"claims": {
"given_name": null
}
}
}
But, the method returns false in the following case.
{
"verified_claims": {
"claims": {
"given_name": {
}
}
}
}
isNull in interface Constrainttrue if the value of the constraint is null.public void setNull(boolean isNull)
isNull - true to indicate that the value of the constraint is null.public ClaimsConstraint putClaim(String claimName, VerifiedClaimConstraint constraint)
This method internally calls put(String, VerifiedClaimConstraint)
method to register the given pair of claim name and constraint and then
returns this object.
claimName - The claim name.constraint - The constraint for the claim.this object.public static ClaimsConstraint extract(Map<?,?> map, String key) throws ConstraintException
ClaimsConstraint instance from an object in the given map.map - A map that may contain "claims".key - The key that identifies the object in the map. In normal cases,
the key is "claims".ClaimsConstraint instance that represents "claims".
Even if the map does not contain the given key, an instance of
ClaimsConstraint is returned.ConstraintException - The structure of the map does not conform to the specification
(OpenID Connect for Identity Assurance 1.0).public Map<String,Object> toMap()
Map instance that represents this object in the way
conforming to the structure defined in 5. Requesting Verified Claims of OpenID Connect for Identity Assurance 1.0.public String toJson()
This method is an alias of toJson(false).
toMap() returns
null, this method returns "null" (a String
instance which consists of 'n', 'u', 'l'
and 'l').public String toJson(boolean pretty)
pretty - true to make the output more human-readable.toMap() returns
null, this method returns "null" (a String
instance which consists of 'n', 'u', 'l'
and 'l').Copyright © 2022. All rights reserved.