Class EvidenceArrayConstraint
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<EvidenceConstraint>
-
- com.authlete.common.assurance.constraint.EvidenceArrayConstraint
-
- All Implemented Interfaces:
Constraint
,Serializable
,Cloneable
,Iterable<EvidenceConstraint>
,Collection<EvidenceConstraint>
,List<EvidenceConstraint>
,RandomAccess
public class EvidenceArrayConstraint extends ArrayList<EvidenceConstraint> implements Constraint
The class that represents the constraint forverified_claims/verification/evidence
.- Since:
- 2.63
- See Also:
- OpenID Connect for Identity Assurance 1.0, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description EvidenceArrayConstraint()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
Check if the key that represents the constraint exists.static EvidenceArrayConstraint
extract(Map<?,?> map, String key)
Create anEvidenceArrayConstraint
instance from an object in the given map.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.List<Map<String,Object>>
toList()
Create aList
instance that represents this object in the way conforming to the structure defined in 5.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
exists
public boolean exists()
Description copied from interface:Constraint
Check if the key that represents the constraint exists. It does not matter whether the value of the key is null or not.For example,
exists()
method of an instance that representsgiven_name
in the JSON below will returntrue
.{ "verified_claims": { "claims": { "given_name": null } } }
- Specified by:
exists
in interfaceConstraint
- Returns:
true
if the key that represents the constraint exists.
-
setExists
public void setExists(boolean exists)
Set the existence of the constraint.- Parameters:
exists
-true
to indicate that the constraint exists.
-
isNull
public boolean isNull()
Description copied from interface:Constraint
Check if the value of the constraint is null.For example,
isNull()
method of an instance that representsgiven_name
in the JSON below will returntrue
.{ "verified_claims": { "claims": { "given_name": null } } }
But, the method returnsfalse
in the following case.{ "verified_claims": { "claims": { "given_name": { } } } }
- Specified by:
isNull
in interfaceConstraint
- Returns:
true
if the value of the constraint is null.
-
setNull
public void setNull(boolean isNull)
Set the boolean flag that indicates that the value of the constraint is null.- Parameters:
isNull
-true
to indicate that the value of the constraint is null.
-
extract
public static EvidenceArrayConstraint extract(Map<?,?> map, String key) throws ConstraintException
Create anEvidenceArrayConstraint
instance from an object in the given map.- Parameters:
map
- A map that may contain"evidence"
.key
- The key that identifies the object in the map. In normal cases, the key is"evidence"
.- Returns:
- An
EvidenceArrayConstraint
instance that represents"evidence"
. Even if the map does not contain the given key, an instance ofEvidenceArrayConstraint
is returned. - Throws:
ConstraintException
- The structure of the map does not conform to the specification (OpenID Connect for Identity Assurance 1.0).
-
toList
public List<Map<String,Object>> toList()
Create aList
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.
-
toJson
public String toJson()
Convert this object into JSON in the way conforming to the structure defined in 5. Requesting Verified Claims of OpenID Connect for Identity Assurance 1.0.This method is an alias of
toJson
(false)
.- Returns:
- JSON that represents this object. If
toList()
returns null, this method returns"null"
(aString
instance which consists of'n'
,'u'
,'l'
and'l'
).
-
toJson
public String toJson(boolean pretty)
Convert this object into JSON in the way conforming to the structure defined in 5. Requesting Verified Claims of OpenID Connect for Identity Assurance 1.0.- Parameters:
pretty
-true
to make the output more human-readable.- Returns:
- JSON that represents this object. If
toList()
returns null, this method returns"null"
(aString
instance which consists of'n'
,'u'
,'l'
and'l'
).
-
-