1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package Torello.Browser;

/**
 * Abstract ancestor exception class for exceptions which check the integrity of instances of
 * both CDP types and CDP events. 
 * 
 * <BR /><BR />
 * Of significant note, when the Browser transmits an object type or event to the
 * {@code Torello.Browser} packages, the Web-Sockets layer parses the Json, and performs a "best 
 * efforts" attempt at constructing an object.  
 * 
 * <BR /><BR />
 * Because throwing exceptions from within the Web-Sockets processing classes and code would cause 
 * an unacceptable level of complexity, and and all classes received from Google's or a compatible
 * Web-Browser <B STYLE='color:red'>are not checked for integrity</B>, but rather constructed and 
 * returned to the user "as is.".
 * 
 * <BR /><BR />
 * Data Integrity consists of two separate requirements:
 * 
 * <BR /><BR /><UL CLASS=JDUL>
 * 
 * <LI> All type and event class fields which have not been declared
 *      <B STYLE='color:red;'><I>optional</B></I> must have a value assigned to their
 *      fields, and contain {@code 'TRUE'} within their respective
 *      {@link BaseType#isPresent()}
 *      list.
 *      </LI>
 * 
 * <LI> Any type or event class fields which have been assigned to a type which has a correlated
 *      <B STYLE='color:red;'><I>Enumerated String List</B></I> must contain a string that is 
 *      listed among the elements of the specified list.
 *      </LI>
 * 
 * </UL>
 * 
 * @see BaseType#optionalsValidate()
 * @see BaseType#optionalsValidateThrow()
 * @see BaseType#isPresent()
 * @see BaseType#enumStrValidate()
 * @see BaseType#enumStrValidateThrow()
 * @see NestedHelper#enumStrValidate(BaseType)
 */
public abstract class DataIntegrityException extends RuntimeException
{
    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX>  */
    public static final long serialVersionUID = 1;

    /** Constructs a {@code DataIntegrityException} with no detail message. */
    protected DataIntegrityException()
    { super(); }

    /**
     * Constructs a {@code DataIntegrityException} with the specified detail message.
     * @param message the detail message.
     */
    protected DataIntegrityException(String message)
    { super(message); }

    /**
     * Constructs a new {@code DataIntegrityException} with the specified detail message and cause.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * <B STYLE='color:red;'>Note:</B> The detail message associated with cause is not
     * automatically incorporated into this exception's detail message.
     * </DIV>
     * 
     * @param message The detail message (which is saved for later retrieval by the
     * {@code Throwable.getMessage()} method).
     * 
     * @param cause the cause (which is saved for later retrieval by the
     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
     * cause is nonexistent or unknown).
     */
    protected DataIntegrityException(String message, Throwable cause)
    { super(message, cause); }

    /**
     * Constructs a new {@code DataIntegrityException} with the specified cause and a detail
     * message of {@code (cause==null ? null : cause.toString())} (which typically contains the
     * class and detail message of cause).
     * 
     * <BR /><BR />This constructor is useful for exceptions that are little more than wrappers for
     * other throwables.
     * 
     * @param cause The cause (which is saved for later retrieval by the
     * {@code Throwable.getCause()} method).  (A null value is permitted, and indicates that the
     * cause is nonexistent or unknown).
     */
    protected DataIntegrityException(Throwable cause)
    { super(cause); }
}