The Validation().constraints property returns a Map with validatable objects as keys and sets of predicate groups associated with them as values.
Value
A Map object.
Description
The main purpose of this property is to access constraints added with the Validation().constraint() method in order to get their current validity state (the property isValid), address additional data that were supplied with them as anyData or add state callbacks to them.
For the reason that several validations can be bound to one validatable object and then grouped into one Validation, this Map contains sets of arrays of “validators” as values. The standard Map iterator and the forEach method are overridden for convinience, so that they iterate over validatable objects as keys and “validators” as values.
These “validator” objects “inherit” all properties and methods of Predicate(), have the property isValid representing their current validity state and are populated with the anyData.
Examples
Iterator, accessing the anyData and the property isValid
Method forEach, adding state callbacks to “validators”