public class BaseConstraint extends Object implements Constraint
verified_claims.
Note that EvidenceArrayConstraint and ClaimsConstraint
don't inherit this class. They implement the Constraint
interface by themselves.
| Constructor and Description |
|---|
BaseConstraint() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Check if the key that represents the constraint exists.
|
boolean |
isNull()
Check if the value of the constraint is null.
|
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. |
public 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 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 © 2020. All rights reserved.