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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
package Torello.Java.JSON;

import Torello.Java.StringParse;
import Torello.Java.UnreachableError;

import Torello.Java.Additional.Ret3;
import Torello.Java.Additional.EffectivelyFinal;
import Torello.Java.Additional.Counter;

import Torello.Java.Function.ToByteFunction;
import Torello.Java.Function.ToFloatFunction;
import Torello.Java.Function.ToShortFunction;

import java.util.*;
import java.util.stream.*;
import java.util.function.*;
import java.math.*;
import javax.json.*;

import java.lang.reflect.Array;

// This is "The Great Sillyness" - it is only used because of the Java-Quirk about constructor's
// not referencing "this" before a call to "super(...)" or "this(...)".  The only way around it I
// have ever found is to use a static-temporary variable, and set its value inside of a static
// helper-method.
//
// This is, essentially, just fine.  However, if the user ever ran this in a multi-threaded program
// it might "get messed up".  TO PREVENT THAT: You have to have a few lines that are synchronized.
// Using the "ReentrantLock" is easier for me to think about than using "synchronized"
//
// NOTE: There is NO MULTI-THREADED CALLS IN THIS CLASS WHATSOEVER.  This is only used as a 
//       "Constructor-Helper"
//
// THIS CLASS IS **VERY** THREAD-SAFE

import java.util.concurrent.locks.ReentrantLock;

import static javax.json.JsonValue.ValueType.*;
import static Torello.Java.JSON.JFlag.*;

/**
 * Utilities for parsing Json Array's into Java Array's.
 * 
 * <EMBED CLASS='external-html' DATA-FILE-ID=GLASS_FISH_NOTE>
 * <EMBED CLASS='external-html' DATA-FILE-ID=READ_ARR_JSON>
 *
 * @see Json
 * @see Json
 * @see JsonArray
 */
@Torello.JavaDoc.StaticFunctional
@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JSON_JDHBI")
public class ReadArrJSON
{
    private ReadArrJSON() { }

    // ********************************************************************************************
    // ********************************************************************************************
    // TEST-PREDICATE'S
    // ********************************************************************************************
    // ********************************************************************************************


    private static final BigInteger LONG_MAX    = BigInteger.valueOf(Long.MAX_VALUE);
    private static final BigInteger LONG_MIN    = BigInteger.valueOf(Long.MIN_VALUE);
    private static final BigInteger SHORT_MAX   = BigInteger.valueOf(Short.MAX_VALUE);
    private static final BigInteger SHORT_MIN   = BigInteger.valueOf(Short.MIN_VALUE);
    private static final BigInteger BYTE_MAX    = BigInteger.valueOf(Byte.MAX_VALUE);
    private static final BigInteger BYTE_MIN    = BigInteger.valueOf(Byte.MIN_VALUE);

    /** 
     * These are eliminated / removed from any call to a method which returns either an array
     * of Java Primitives or a Java Primitive Stream
     * 
     * @see #intArrayToStream(JsonArray, int, int, ToIntFunction)
     * @see #longArrayToStream(JsonArray, long, int, ToLongFunction)
     * @see #doubleArrayToStream(JsonArray, double, int, ToDoubleFunction)
     * @see #byteArray(JsonArray, byte, int, ToByteFunction)
     * @see #floatArray(JsonArray, float, int, ToFloatFunction)
     * @see #shortArray(JsonArray, short, int, ToShortFunction)
     * @see #booleanArray(JsonArray, boolean, int, Predicate)
     */
    public static final int NOT_ALLOWED_RET_NULL_MASKS = ~(RETURN_NULL_ON_ANY_ALL |
        RETURN_NULL_ON_AEX | RETURN_NULL_ON_NULL | RETURN_NULL_ON_SPEX | RETURN_NULL_ON_STR |
        RETURN_NULL_ON_0LEN_STR | RETURN_NULL_ON_WRONG_JSONTYPE | INSERT_NULL_ON_NON_SUBARRAY_TYPE);


    // For "Integer", the javax.json will always return an instance of "Integer" if the JsonNumber
    // is, indeed, a valid Integer.  This doesn't work for Long - even though java.json will return
    // an instance of boxed-type "Long" when the number is a Long because if the user has requested
    // a LongStream, and an Integer was parsed (because the number was between 0 and MAX_INT), then
    // just checking the Class of the returned value will fail.
    //
    // Converting to a returned "Integer" or "Long" to a "BigInteger" is extremely cheap, and fast,
    // since the class BigInteger will just save the "Integer" internally.


    private static boolean shortTypePred(JsonNumber jn)
    {
        if (! jn.isIntegral()) return false;

        BigInteger bi = jn.bigIntegerValue();
        int signum = bi.signum();

        return  ((signum > 0) && (bi.compareTo(SHORT_MAX) <= 0))
            ||  ((signum < 0) && (bi.compareTo(SHORT_MIN) >= 0))
            ||  (signum == 0);
    }

    private static boolean byteTypePred(JsonNumber jn)
    {
        if (! jn.isIntegral()) return false;

        BigInteger bi = jn.bigIntegerValue();
        int signum = bi.signum();

        return  ((signum > 0) && (bi.compareTo(BYTE_MAX) <= 0))
            ||  ((signum < 0) && (bi.compareTo(BYTE_MIN) >= 0))
            ||  (signum == 0);
    }

    private static boolean doubleTypePred(JsonNumber jn)
    { return true; /* for now!  Only bizzare & egregious cases won't fit into a double... */ }

    private static boolean floatTypePred(JsonNumber jn)
    { return true; }

    private static boolean longTypePred(JsonNumber jn)
    {
        if (! jn.isIntegral()) return false;

        BigInteger bi = jn.bigIntegerValue();
        int signum = bi.signum();

        return  ((signum > 0) && (bi.compareTo(LONG_MAX) <= 0))
            ||  ((signum < 0) && (bi.compareTo(LONG_MIN) >= 0))
            ||  (signum == 0);
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // HELPER-RECORD
    // ********************************************************************************************
    // ********************************************************************************************


    // NOTE: It is **A LOT** Smarter to check for the exception instead of using the try-catch
    //       since I have read that generating an exception is one of the most costly-expensive
    //       things the JRE does.  It isn't the Exception-Constructor that costs a lot - it is the
    //       creating of the **STACK-TRACE** that costs well over 100 to 1,000 times the number of
    //       of CPU-Cycles that the cost of a simple constructor.  This is an "Only if abolutely"
    //       necessary things.

    private static <T extends Number> ArithmeticException getAEX
        (JsonNumber jn, Function<BigDecimal, ?> converter)
    {
        try
            { converter.apply(jn.bigDecimalValue()); }
        catch (ArithmeticException aex)
            { return aex; }

        throw new UnreachableError();
    }

    private static Exception getSPEX(String s, Function<String, ?> converter)
    {
        try
            { converter.apply(s); }
        catch (Exception e)
            { return e; }

        throw new UnreachableError();
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // RECORD Configuration-Class
    // ********************************************************************************************
    // ********************************************************************************************


    private static class RECORD<T, U>
    {
        // Assigned after construction, cannot be final
        private JsonArray ja;

        private final T defaultValue;

        private final boolean RJA_AEX, RTS_WT, IN_NSAT, S_NSAT;

        private final Runnable handlerNull, handlerAEX, handlerSPEX, handlerZLS, handlerWrongType;
        private final ObjIntConsumer<JsonValue> handlerJsonString;

        private final Class<T>                  CLASS;
        private final Predicate<JsonNumber>     jsonNumWillFit;
        private final Predicate<String>         validStrTester;
        private final Function<String, T>       defaultParser;
        private final Function<Number, T>       numberConverter;
        private final Function<BigDecimal, T>   numberConverterExThrow;
        private final Function<String, T>       userParser;

        // NOTE: This class "RECORD" can handle the standard "Stream<T>", but it can also handle
        //       the three primitive-Stream's: IntStream, LongStream and DoubleStream.
        //
        // Therefore these are kept as separate function-pointers.  If it weren't for those three
        // primitive-streams, this would be completely unnecessary.   YES, this class is a little
        // hard to read.

        private final Runnable      c;  // Stream.builder()
        private final Consumer<T>   a;  // Stream.Builder.accept(T)
        private final Supplier<U>   b;  // Stream.Builder.build()


        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        // This is only used by the methods in the nested-class "DimN"
        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        //
        // This is not final, because it is set after the constructor. 
        //
        // Since the user is incapable of accessing any of this, and since great care has been 
        // taken to rigorously test all of this stuff, it is basically unimportant.

        private Function<JsonArray, Object> array1DGenerator = null;


        // ****************************************************************************************
        // ****************************************************************************************
        // PRIMARY RECORD Constructor
        // ****************************************************************************************
        // ****************************************************************************************


        private RECORD(
                T                       defaultValue,
                int                     FLAGS,

                Class<T>                CLASS,
                Predicate<JsonNumber>   jsonNumWillFit,
                Predicate<String>       validStrTester,
                Function<String, T>     defaultParser,
                Function<Number, T>     numberConverter,
                Function<BigDecimal, T> numberConverterExThrow,
                Function<String, T>     userParser,
                boolean                 NULLS,

                Runnable                streamConstructor,
                Consumer<T>             streamAcceptor,
                Supplier<U>             streamBuilder
            )
        {
            this.defaultValue           = defaultValue;     // User-Provided Default-Value
            this.CLASS                  = CLASS;            // Class of the Stream.Builder "accept" Parameter
            this.jsonNumWillFit         = jsonNumWillFit;   // Checks if JsonNumber will fit properly
            this.validStrTester         = validStrTester;   // Used for Verifying a JsonString
            this.defaultParser          = defaultParser;    // Default JsonString Parser to Number
            this.numberConverter        = numberConverter;  // interface java.lang.Number method
            this.numberConverterExThrow = numberConverterExThrow;
            this.userParser             = userParser;       // Optional User Parser

            this.c = streamConstructor;    // Stream.builder()
            this.a = streamAcceptor;       // Stream.Builder.accept()
            this.b = streamBuilder;        // Stream.Builder.build()

            this.RJA_AEX    = (FLAGS & RETURN_JAPPROX_ON_AEX) > 0;
            this.RTS_WT     = (FLAGS & RETURN_TOSTRING_ON_WRONGTYPE) > 0;
            this.IN_NSAT    = (FLAGS & INSERT_NULL_ON_NON_SUBARRAY_TYPE) > 0;
            this.S_NSAT     = (FLAGS & SKIP_ON_NON_SUBARRAY_TYPE) > 0;

            boolean RN_AA   = NULLS && ((FLAGS & RETURN_NULL_ON_ANY_ALL) > 0);
            boolean RD_AA   = (FLAGS & RETURN_DEFVAL_ON_ANY_ALL) > 0;
            boolean S_AA    = (FLAGS & SKIP_ON_ANY_ALL) > 0;

            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // Null Handler (JsonNull was in the JsonArray)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(), AD() and NOOP() are just one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)

            if (NULLS && ((FLAGS & RETURN_NULL_ON_NULL) > 0))   handlerNull = this::AN;
            else if ((FLAGS & RETURN_DEFVAL_ON_NULL) > 0)       handlerNull = this::AD;
            else if ((FLAGS & SKIP_ON_NULL) > 0)                handlerNull = this::NOOP;
            else if (NULLS && RN_AA)                            handlerNull = this::AN;
            else if (RD_AA)                                     handlerNull = this::AD;
            else if (S_AA)                                      handlerNull = this::NOOP;
            else if (NULLS)                                     handlerNull = this::AN;
            else                                                handlerNull = null;


            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // AEX Handler (ArithmeticException)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(), AD() and NOOP() are just one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)

            if (NULLS && ((FLAGS & RETURN_NULL_ON_AEX) > 0))    handlerAEX = this::AN;
            else if ((FLAGS & RETURN_DEFVAL_ON_AEX) > 0)        handlerAEX = this::AD;
            else if ((FLAGS & SKIP_ON_AEX) > 0)                 handlerAEX = this::NOOP;
            else if (NULLS && RN_AA)                            handlerAEX = this::AN;
            else if (RD_AA)                                     handlerAEX = this::AD;
            else if (S_AA)                                      handlerAEX = this::NOOP;
            else                                                handlerAEX = null;


            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // SPEX Handler (Exception while parsing a String into the Java-Type)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(), AD() and NOOP() are just one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)

            if (NULLS && ((FLAGS & RETURN_NULL_ON_SPEX) > 0))   handlerSPEX = this::AN;
            else if ((FLAGS & RETURN_DEFVAL_ON_SPEX) > 0)       handlerSPEX = this::AD;
            else if ((FLAGS & SKIP_ON_SPEX) > 0)                handlerSPEX = this::NOOP;
            else if (NULLS && RN_AA)                            handlerSPEX = this::AN;
            else if (RD_AA)                                     handlerSPEX = this::AD;
            else if (S_AA)                                      handlerSPEX = this::NOOP;
            else                                                handlerSPEX = null;


            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // ZLS Handler (A Zero-Length String was in the JsonArray)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(), AD() and NOOP() are just one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)

            if (NULLS && ((FLAGS & RETURN_NULL_ON_0LEN_STR) > 0))   handlerZLS = this::AN;
            else if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) > 0)       handlerZLS = this::AD;
            else if ((FLAGS & SKIP_ON_0LEN_STR) > 0)                handlerZLS = this::NOOP;
            else if (NULLS && RN_AA)                                handlerZLS = this::AN;
            else if (RD_AA)                                         handlerZLS = this::AD;
            else if (S_AA)                                          handlerZLS = this::NOOP;
            else                                                    handlerZLS = null;


            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // Wrong-Type Handler (A JsonObject or a nested-JsonArray was in an array position)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(), AD() and NOOP() are just one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)
            //
            // ALSO: RN_WT & RD_WT are the abbreviated-flags for "ON_WRONG_JSONTYPE"

            if (NULLS && ((FLAGS & RN_WT) > 0))             handlerWrongType = this::AN;
            else if ((FLAGS & RD_WT) > 0)                   handlerWrongType = this::AD;
            else if ((FLAGS & SKIP_ON_WRONG_JSONTYPE) > 0)  handlerWrongType = this::NOOP;
            else if (NULLS && RN_AA)                        handlerWrongType = this::AN;
            else if (RD_AA)                                 handlerWrongType = this::AD;
            else if (S_AA)                                  handlerWrongType = this::NOOP;
            else                                            handlerWrongType = null;


            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            // JsonString Handler (This was *ALSO* moved here to get rid of more of the if's)
            // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            //
            // NOTE: AN(JsonValue, int), AD(JsonValue, int) and NOOP(JsonValue, int) are just
            //       one-line private methods that:
            //       a.accept(null), a.accept(defaultValue), and {} ==> do nothing (SKIP)

            if (userParser != null)         handlerJsonString = this::useUserParser;
            else if ((FLAGS & RP_S) > 0)    handlerJsonString = this::parseString;
            else if (NULLS && ((FLAGS & RETURN_NULL_ON_STR) > 0))   handlerJsonString = this::AN;
            else if ((FLAGS & RETURN_DEFVAL_ON_STR) > 0)            handlerJsonString = this::AD;
            else if ((FLAGS & SKIP_ON_STR) > 0)                     handlerJsonString = this::NOOP;
            else if (NULLS && RN_AA)                                handlerJsonString = this::AN;
            else if (RD_AA)                                         handlerJsonString = this::AD;
            else if (S_AA)                                          handlerJsonString = this::NOOP;
            else handlerJsonString = (JsonValue jv, int i) ->
                { throw new JsonTypeArrException (this.ja, i, NUMBER, jv, this.CLASS); };
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Boxed-Primitive Stream RECORD Contructor
        // ****************************************************************************************
        // ****************************************************************************************


        @SuppressWarnings({"unchecked"})
        private RECORD(
                T                       defaultValue,
                int                     FLAGS,

                Class<T>                CLASS,
                Predicate<JsonNumber>   jsonNumWillFit,
                Predicate<String>       validStrTester,
                Function<String, T>     defaultParser,
                Function<Number, T>     numberConverter,
                Function<BigDecimal, T> numberConverterExThrow,
                Function<String, T>     userParser
            )
        {
            this(
                defaultValue, FLAGS,

                CLASS, jsonNumWillFit, validStrTester, defaultParser, numberConverter,
                numberConverterExThrow, userParser, true,

                constructorHelper(new EffectivelyFinal<>(null)),//, CLASS, Stream.class),
                (Consumer<T>)   constructorHelper.b,    // Un-Checked Cast
                (Supplier<U>)   constructorHelper.c     // Un-Checked Cast
            );

            // Essentially, the lock is only used for about three instructions that are inside the
            // method "constructorHelper".  It, sort-of, "borrows" a private static-field for just
            // a moment, so that the values can be passed to the call to "this(...)", which is
            // just  "kind-of" faking out the compiler so I can do some processing before calling
            // "this(...)" as above
            //
            // Now that the loan-out is over, unlock the lock, and it can be used in another call

            lock.unlock();

            // THIS CLASS *IS* THREAD SAFE, 
            // THIS Nested-Class "RECORD" IS NOT THREAD-SAFE - EXCEPT THE USER IS NOT ALLOWED ACCESS,
            // AND MAY NOT OBTAIN AN INSTNANCE OF "RECORD", so it all works just fine, even in a
            // multi-threaded program!

            /*
            // OLD CODE - DON'T ERASE THIS, EVEN BEFORE THE LOCK, THIS WAS KIND OF UGLY

            final EffectivelyFinal<Stream.Builder<T>> EFSB = new EffectivelyFinal<>(null);

            this.c = ()     -> EFSB.f = Stream.builder();
            this.a = (T t)  -> EFSB.f.accept(t);
            this.b = ()     -> (U) EFSB.f.build();
            */
        }

        // These are the "Contructor Helpers" that are mentioned at the top of this class (in the
        // "import-statement" section).  These are just here to help by-pass the Java Requirement
        // that calls to "this(...)" and "super(...)" occur on the first line.

        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        // This is NOT TO BE UNDERSTOOD BY MORTAL-MEN, SO DON'T ASK
        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        //
        // The **MAIN-POINT** of all this non-sense is that at **RUNTIME** (as you should know by
        // by now) all Generic-Type Information has been erased.  An instance of class Object is
        // no different than an instance of class String, Integer or anything else.  It is just a
        // pointer to a class.
        //
        // This whole thing is just "Faking Out The Compiler"
        //
        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        // Mostly, I am very used to having all the fields in Class "RECORD" being declared FINAL
        // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        //
        // It is very soothing to know that the constructor is "setting everything up", and the
        // Json-Processor stuff isn't going to do anything with the configurations (because they
        // are all declared FINAL).

        private static final ReentrantLock lock = new ReentrantLock();

        @SuppressWarnings("rawtypes")
        private static Ret3 constructorHelper;

        @SuppressWarnings({"rawtypes", "unchecked"})
        private static Runnable constructorHelper(final EffectivelyFinal<Stream.Builder> EFSB)
        {
            lock.lock();

            // If you don't understand this line, oh well...
            //
            // This was "built" or "developed" in a step-wise fasion.
            // There is a WHOLE-BUNCH of testing code, and it all worked.  All this 'type-magic' is
            // doing is tricking the java compiler, so I can have my way.
            //
            // Every time I play with the types, I go back and run a GIANT-STACK of TEST
            // PROCEDURES.  If they all work, I know this works.  This is **NOT REALLY** a good
            // software-writing  practice, **HOWEVER** Java-Generics are sometimes a real problem.
            //
            // The purpose of having TYPES in a programming language is to help catch programming
            // errors early-on at compile-time.  Java does this pretty well, but when things get
            // advanced (it is always with Function-Pointers - a.k.a. "Functional-Interfaces" and
            // Lambda-Expressions)... when things get "ADVANCED" it is sometimes a little
            // ridiculours.
            //
            // When they say that Java-Script is a "TYPE-LESS" language at that it is easier, well,
            // Java-Script has tons of Run-Time errors that can be impossible to debug/find!
            //
            // There is no real-way that I can think of to "improve" generics, because all the are
            // in the first-place is a little "Help Finding the Errors" at Compile-Time thing...

            constructorHelper = new Ret3<Runnable, Consumer, Supplier>(
                (Runnable)  (()         -> EFSB.f = Stream.builder()),
                (Consumer)  ((Object o) -> EFSB.f.accept(o)),
                (Supplier)  (()         -> /*(B)*/ EFSB.f.build())
            );

            return (Runnable) constructorHelper.a;
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // HELPER'S FOR THE HANDLERS
        // ****************************************************************************************
        // ****************************************************************************************

        private void AN()   { a.accept(null); }
        private void AD()   { a.accept(defaultValue); }
        private void NOOP() { }

        private void AN(JsonValue jv, int i)    { a.accept(null); }
        private void AD(JsonValue jv, int i)    { a.accept(defaultValue); }
        private void NOOP(JsonValue jv, int i)  { }

        private void useUserParser(JsonValue jv, int i)
        {
            try
            {
                this.a.accept
                    (this.userParser.apply(((JsonString) jv).getString()));
            }

            catch (Exception e)
            {
                if (this.handlerSPEX != null) this.handlerSPEX.run();
                else throw new JsonStrParseArrException(e, this.ja, i, jv, this.CLASS);
            }
        };

        private void parseString(JsonValue jv, int i)
        {
            String s = ((JsonString) jv).getString();

            if (s.length() == 0)
            {
                if (this.handlerZLS != null) this.handlerZLS.run();

                else throw new JsonStrParseArrException(
                    new IllegalArgumentException("Zero Length String"),
                    this.ja, i, jv, this.CLASS
                );
            }

            // StringParse.isInteger(s), isLong(String) **AND** s -> true (Double)
            else if (this.validStrTester.test(s))

                // Integer.parseInt(String), Long.parseLong, Double.parseDouble
                this.a.accept(this.defaultParser.apply(s));

            else if (this.handlerSPEX != null) this.handlerSPEX.run();

            else throw new JsonStrParseArrException
                (getSPEX(s, this.defaultParser), this.ja, i, jv, this.CLASS);
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Static RECORD Factory/Builder Methods  --  Primitive-Streams
        // ****************************************************************************************
        // ****************************************************************************************


        private static RECORD<Integer, IntStream> getIntStreamRec
            (int defaultValue, int FLAGS, ToIntFunction<String> optionalUserParser)
        {
            EffectivelyFinal<IntStream.Builder> EFISB = new EffectivelyFinal<>(null);

            RECORD<Integer, IntStream> rec = new RECORD<>(
                defaultValue, 
                FLAGS,

                // The class of the (only) parameter to the Stream.Builder "accept" method
                int.class,

                // A simple way to test if there will be an "ArithmeticException"
                // Somewhat "counter-intuitive", but it works great...

                (JsonNumber jn) -> Integer.class == jn.numberValue().getClass(),

                StringParse::isInteger,     // number-string-tester
                Integer::parseInt,          // default-parser (string to int)
                Number::intValue,           // numberConverter
                BigDecimal::intValueExact,  // cause AEX (ArithmeticException)

                // Parse Number-Strings (this may be null)
                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!

                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsInt(s)
                    : null, 

                // Primitive (nulls not allowed)
                false,

                ()          -> EFISB.f = IntStream.builder(),   // Stream.Builder constructor
                (Integer x) -> EFISB.f.accept(x),               // Builder "accept" Function-Ptr
                ()          -> EFISB.f.build()                  // Builder "build" Function-Ptr
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON

            rec.array1DGenerator =
                (JsonArray ja) -> jsonArrToStream(ja, rec).toArray();

            return rec;
        }

        private static RECORD<Long, LongStream> getLongStreamRec
            (long defaultValue, int FLAGS, ToLongFunction<String> optionalUserParser)
        {
            EffectivelyFinal<LongStream.Builder> EFLSB = new EffectivelyFinal<>(null);
    
            RECORD<Long, LongStream> rec = new RECORD<>(
                defaultValue,
                FLAGS,

                long.class,                 // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::longTypePred,  // Checks the JsonNumber retrieved
                StringParse::isLong,        // String-tester (for parsing number-strings)
                Long::parseLong,            // default-parser (number-string to long)
                Number::longValue,          // numberConverter
                BigDecimal::longValueExact, // Generates AEX (ArithmeticException)

                // Parse Number-Strings (this may be null)
                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!

                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsLong(s)
                    : null,

                // Primitive (nulls not allowed)
                false,

                () ->       EFLSB.f = LongStream.builder(), // Stream.Builder constructor
                (Long x) -> EFLSB.f.accept(x),              // Builder "accept" Function-Pointer
                () ->       EFLSB.f.build()                 // Builder "build" Function-Pointer
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON

            rec.array1DGenerator =
                (JsonArray ja) -> jsonArrToStream(ja, rec).toArray();

            return rec;
        }

        private static RECORD<Double, DoubleStream> getDoubleStreamRec
            (double defaultValue, int FLAGS, ToDoubleFunction<String> optionalUserParser)
        {
            EffectivelyFinal<DoubleStream.Builder> EFDSB = new EffectivelyFinal<>(null);

            RECORD<Double, DoubleStream> rec = new RECORD<>(
                defaultValue,
                FLAGS,

                double.class,                   // Stream.Builder "accept" Parameter-Class
                ReadArrJSON::doubleTypePred,    // Checks the JsonNumber retrieved
                StringParse::isDouble,          // String-tester (for parsing number-strings)
                Double::parseDouble,            // default-parser (number-string to double)
                (Number n) -> n.doubleValue(),  // numberConverter

                // Generate an AEX if the "StringParse.isDouble" failed
                (BigDecimal bd) -> { throw new ArithmeticException("Invalid Input"); },

                // Parse Number-Strings (this may be null)
                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!

                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsDouble(s)
                    : null,

                // Primitive (nulls not allowed)
                false,

                ()          -> EFDSB.f = DoubleStream.builder(),    // Stream.Builder constructor
                (Double x)  -> EFDSB.f.accept(x),                   // Builder "accept" FunctionPtr
                ()          -> EFDSB.f.build()                      // Builder "build" FunctionPtr
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON

            rec.array1DGenerator =
                (JsonArray ja) -> jsonArrToStream(ja, rec).toArray();

            return rec;
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Static RECORD Factory/Builder Methods  --  Boxed-Primitive-Streams
        // ****************************************************************************************
        // ****************************************************************************************


        private static RECORD<Integer, Stream<Integer>> getINTEGERStreamRec
            (int defaultValue, int FLAGS, Function<String, Integer> optionalUserParser)
        {
            RECORD<Integer, Stream<Integer>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Integer.class,              // Class of the Stream.Builder "accept" Parameter
                (JsonNumber jn) -> jn.numberValue().getClass() == Integer.class,
                StringParse::isInteger,     // String-tester (for parsing number-strings)
                Integer::parseInt,          // default-parser (number-string to Integer)
                Number::intValue,           // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                BigDecimal::intValueExact,  // Generates AEX on fail
                optionalUserParser
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON.
            // Note that this produces a Boxed-Type Array **ONLY**, if the user wants a 
            // primitive "int[]" array (rather than an "Integer[]"), "IntStream.toArray" is used

            rec.array1DGenerator = (JsonArray ja) ->
                jsonArrToBoxedStream(ja, rec).toArray(Integer[]::new);

            return rec;
        }

        private static RECORD<Short, Stream<Short>> getSHORTStreamRec(
                short defaultValue, int FLAGS, Function<String, Short> optionalUserParser,
                boolean primitiveOrBoxedOutput1DArray
            )
        {
            RECORD<Short, Stream<Short>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Short.class,                    // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::shortTypePred,     // Checks the JsonNumber retrieved
                StringParse::isShort,           // String-tester (for parsing number-strings)
                Short::parseShort,              // default-parser (number-string to short)
                Number::shortValue,             // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                BigDecimal::shortValueExact,    // Generates AEX on fail
                optionalUserParser
            );

            // Only used by "DimN" Sub-Class.  It builds the 1D arrays.  Since short's do not have
            // a "BoxedStream" (and ergo, do not have a ShortStream.toArray method), this must be
            // used to dispatch-build *BOTH* a short[] and a Short[]

            rec.array1DGenerator = primitiveOrBoxedOutput1DArray
                ? rec::array1DGeneratorShort
                : (JsonArray ja) -> jsonArrToBoxedStream(ja, rec).toArray(Short[]::new);

            return rec;
        }

        private static RECORD<Byte, Stream<Byte>> getBYTEStreamRec(
                byte defaultValue, int FLAGS, Function<String, Byte> optionalUserParser,
                boolean primitiveOrBoxedOutput1DArray
            )
        {
            RECORD<Byte, Stream<Byte>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Byte.class,                 // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::byteTypePred,  // Checks the JsonNumber retrieved
                StringParse::isByte,        // String-tester (for parsing number-strings)
                Byte::parseByte,            // default-parser (number-string to byte)
                Number::byteValue,          // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                BigDecimal::byteValueExact, // Generates AEX on fail
                optionalUserParser
            );

            // Only used by "DimN" Sub-Class.  It builds the 1D arrays.  Since short's do not have
            // a "BoxedStream" (and ergo, do not have a ShortStream.toArray method), this must be
            // used to dispatch-build *BOTH* a short[] and a Short[]

            rec.array1DGenerator = primitiveOrBoxedOutput1DArray
                ? rec::array1DGeneratorByte
                : (JsonArray ja) -> jsonArrToBoxedStream(ja, rec).toArray(Byte[]::new);

            return rec;
        }

        private static RECORD<Long, Stream<Long>> getLONGStreamRec
            (long defaultValue, int FLAGS, Function<String, Long> optionalUserParser)
        {
            RECORD<Long, Stream<Long>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Long.class,                 // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::longTypePred,  // Checks the JsonNumber retrieved
                StringParse::isLong,        // String-tester (for parsing number-strings)
                Long::parseLong,            // default-parser (number-string to long)
                Number::longValue,          // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                BigDecimal::longValueExact, // Generates AEX on fail
                optionalUserParser
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON.
            // Note that this produces a Boxed-Type Array **ONLY**, if the user wants a 
            // primitive "long[]" array (rather than an "Long[]"), "LongStream.toArray" is used

            rec.array1DGenerator = (JsonArray ja) ->
                jsonArrToBoxedStream(ja, rec).toArray(Long[]::new);

            return rec;
        }

        private static RECORD<Double, Stream<Double>> getDOUBLEStreamRec
            (double defaultValue, int FLAGS, Function<String, Double> optionalUserParser)
        {
            RECORD<Double, Stream<Double>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Double.class,                   // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::doubleTypePred,    // Checks the JsonNumber retrieved
                StringParse::isDouble,          // String-tester (for parsing number-strings)
                Double::parseDouble,            // default-parser (number-string to double)
                Number::doubleValue,            // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                (BigDecimal bd) -> { throw new ArithmeticException("Invalid Input"); },
                optionalUserParser
            );

            // This is used by the methods in the Nested-Class "DimN" only.  It is a wrapper
            // for the JsonArray -> JavaArray method.  This is *NOT* used in ReadArrJSON.
            // Note that this produces a Boxed-Type Array **ONLY**, if the user wants a 
            // primitive "double[]" array (rather than an "Double[]"), "DoubleStream.toArray" is
            // used

            rec.array1DGenerator = (JsonArray ja) ->
                jsonArrToBoxedStream(ja, rec).toArray(Double[]::new);

            return rec;
        }

        private static RECORD<Float, Stream<Float>> getFLOATStreamRec(
                float defaultValue, int FLAGS, Function<String, Float> optionalUserParser,
                boolean primitiveOrBoxedOutput1DArray
            )
        {
            RECORD<Float, Stream<Float>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Float.class,                // Class of the Stream.Builder "accept" Parameter
                ReadArrJSON::floatTypePred, // Checks the JsonNumber retrieved
                StringParse::isDouble,      // String-tester (for parsing number-strings)
                Float::parseFloat,          // default-parser (number-string to float)
                Number::floatValue,         // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                (BigDecimal bd) -> { throw new ArithmeticException("Invalid Input"); },
                optionalUserParser
            );

            // Only used by "DimN" Sub-Class.  It builds the 1D arrays.  Since short's do not have
            // a "BoxedStream" (and ergo, do not have a ShortStream.toArray method), this must be
            // used to dispatch-build *BOTH* a short[] and a Short[]

            rec.array1DGenerator = primitiveOrBoxedOutput1DArray
                ? rec::array1DGeneratorFloat
                : (JsonArray ja) -> jsonArrToBoxedStream(ja, rec).toArray(Float[]::new);

            return rec;
        }

        private static RECORD<Boolean, Stream<Boolean>> getBOOLEANStreamRec(
                boolean defaultValue, int FLAGS, Function<String, Boolean> optionalUserParser,
                boolean primitiveOrBoxedOutput1DArray
            )
        {
            RECORD<Boolean, Stream<Boolean>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Boolean.class,          // Class of the Stream.Builder "accept" Parameter
                null,                   // Checks the JsonNumber retrieved
                s -> true,              // String-tester (for parsing number-strings)
                Boolean::parseBoolean,  // default-parser (number-string to float)
                null,                   // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                null,
                optionalUserParser
            );

            // Only used by "DimN" Sub-Class.  It builds the 1D arrays.  Since short's do not have
            // a "BoxedStream" (and ergo, do not have a ShortStream.toArray method), this must be
            // used to dispatch-build *BOTH* a short[] and a Short[]

            rec.array1DGenerator = primitiveOrBoxedOutput1DArray
                ? rec::array1DGeneratorBoolean
                : (JsonArray ja) -> jsonArrToBoxedStream(ja, rec).toArray(Boolean[]::new);

            return rec;
        }

        private static RECORD<Number, Stream<Number>> getNumberStreamRec
            (Number defaultValue, int FLAGS, Function<String, Number> optionalUserParser)
        {
            RECORD<Number, Stream<Number>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                Number.class,               // Class of the Stream.Builder "accept" Parameter
                (JsonNumber jn) -> true,    // Checks the JsonNumber retrieved
                StringParse::isDouble,      // String-tester (for parsing number-strings)
                Float::parseFloat,          // default-parser (number-string to float)
                (Number n) -> n,            // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                (BigDecimal bd) -> { throw new ArithmeticException("Invalid Input"); },
                optionalUserParser
            );

            rec.array1DGenerator = (JsonArray ja) ->
                jsonArrToBoxedStream(ja, rec).toArray(Number[]::new);

            return rec;
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Static RECORD Factory/Builder Methods  --  Other-Streams
        // ****************************************************************************************
        // ****************************************************************************************


        private static RECORD<String, Stream<String>>
            getStringStreamRec(String defaultValue, int FLAGS)
        {
            RECORD<String, Stream<String>> rec = new RECORD<String, Stream<String>> (
                defaultValue,
                FLAGS,
                String.class,       // Class of the Stream.Builder "accept" Parameter
                null,               // Checks the JsonNumber retrieved
                null,               // String-tester (for parsing number-strings)
                null,               // default-parser (number-string to float)
                null,               // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                null,               // Generates AEX on fail
                null                // optionalUserParser
            );

            rec.array1DGenerator = (JsonArray ja) ->
                strArrayToStreamINTERNAL(ja, rec).toArray(String[]::new);

            return rec;
        }

        @SuppressWarnings("unchecked") // Array.newInstance returns "Object" not 
        private static <X> RECORD<X, Stream<X>>
            getObjectStreamRec(X defaultValue, int FLAGS, Class<X> returnClass)
        {
            RECORD<X, Stream<X>> rec = new RECORD<>(
                defaultValue,
                FLAGS,
                returnClass,        // Class of the Stream.Builder "accept" Parameter
                null,               // Checks the JsonNumber retrieved
                null,               // String-tester (for parsing number-strings)
                null,               // default-parser (number-string to float)
                null,               // numberConverter (JAPPROX_ON_AEX *AND* usual-ans)
                null,
                null                // optionalUserParser
            );

            rec.array1DGenerator = (JsonArray ja) ->
               objArrayToStreamINTERNAL(ja, rec).toArray
                   ((int length) -> (X[]) Array.newInstance(returnClass, length));

            return rec;
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Static RECORD Factory/Builder ==> HELPERS FOR THE FACTORY-METHODS
        // ****************************************************************************************
        // ****************************************************************************************
        //
        // REMEMBER: The 1-D Arrays ==> int[], long[], double[] are built directly from a 
        //           PrimitiveStream using PrimStream.toArray, they don't need a "helper"


        // This method is only used if the input was "Short", so it is actually not "Unchecked"
        // but the Java-Compiler isn't smart enough to see that.
        @SuppressWarnings("unchecked")
        private short[] array1DGeneratorShort(JsonArray ja)
        {
            short[] retArrShort = new short[ja.size()];

            return boxedStreamToPrimitiveArray(
                jsonArrToBoxedStream(ja, (RECORD<Short, Stream<Short>>) this),
                ja,
                short.class,
                (Short s, int i) -> retArrShort[i] = s.shortValue(),
                retArrShort
            );
        }

        // This method is only used if the input was "Byte", so it is actually not "Unchecked"
        // but the Java-Compiler isn't smart enough to see that.
        @SuppressWarnings("unchecked")
        private byte[] array1DGeneratorByte(JsonArray ja)
        {
            byte[] retArrByte = new byte[ja.size()];

            return boxedStreamToPrimitiveArray(
                jsonArrToBoxedStream(ja, (RECORD<Byte, Stream<Byte>>) this),
                ja,
                byte.class,
                (Byte s, int i) -> retArrByte[i] = s.byteValue(),
                retArrByte
            );
        }

        // This method is only used if the input was "Float", so it is actually not "Unchecked"
        // but the Java-Compiler isn't smart enough to see that.
        @SuppressWarnings("unchecked")
        private float[] array1DGeneratorFloat(JsonArray ja)
        {
            float[] retArrFloat = new float[ja.size()];

            return boxedStreamToPrimitiveArray(
                jsonArrToBoxedStream(ja, (RECORD<Float, Stream<Float>>) this),
                ja,
                float.class,
                (Float s, int i) -> retArrFloat[i] = s.floatValue(),
                retArrFloat
            );
        }

        // This method is only used if the input was "Boolean", so it is actually not "Unchecked"
        // but the Java-Compiler isn't smart enough to see that.
        @SuppressWarnings("unchecked")
        private boolean[] array1DGeneratorBoolean(JsonArray ja)
        {
            boolean[] retArrBoolean = new boolean[ja.size()];

            return boxedStreamToPrimitiveArray(
                booleanArrayToBoxedStreamINTERNAL
                    (ja, (RECORD<Boolean, Stream<Boolean>>) this),
                ja,
                boolean.class,
                (Boolean s, int i) -> retArrBoolean[i] = s.booleanValue(),
                retArrBoolean
            );
        }
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // PRIMARY CONVERTER FOR THREE STREAM FUNCTIONS
    // ********************************************************************************************
    // ********************************************************************************************
    //
    // NOTE: There is just no-way to document this damned thing.  *ALL IT IS DOING* is telling you
    //       that a Json-Array like [3, 4, 5] maps to a Java-Array like [3, 4, 5].  The extra
    //       work is checking for things like ["3", 4, 5] (where the 3 is a String), since this
    //       is completely legal in JSON, but not Java.  AND ALSO: [3.0, 4.1, 5.2] can be mapped
    //       to [3, 4, 5] - if and only if the FLAGS are properly set by the user...
    //
    // The whole value of this is the error-checking, and the ability to TIGHTEN AND RELAX the
    // requirements.  It makes using a REST-API (which communicates with the outside world using
    // JSON), a whole bunch of ONE-LINE statments.  (This HELPS a lot, but it is so AWFUL to look
    // at)

    /**
     * Builds a Primitive-Stream from a {@link JsonArray}
     * 
     * @param ja The {@link JsonArray}
     * @param rec The configurations
     * 
     * @throws JsonNullPrimitiveArrException <EMBED CLASS='external-html'
     *      DATA-FILE-ID=RARR_PS_JNPAEX>
     * 
     * @throws JsonArithmeticArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_PS_JAAEX>
     * @throws JsonStrParseArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_PS_JSPAEX>
     * @throws JsonTypeArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_PS_JTAEX>
     */
    protected static <T, U> U jsonArrToStream(JsonArray ja, RECORD<T, U> rec)
    {
        rec.ja = ja;
        rec.c.run();    // Construct a new Stream-Builder

        int SIZE = ja.size();
        JsonValue jv;

        for (int i=0; i < SIZE; i++)

            switch ((jv = ja.get(i)).getValueType())
            {
                // javax.json.JsonValue.ValueType.NULL
                case NULL:
                    if (rec.handlerNull != null) rec.handlerNull.run();
                    else throw new JsonNullPrimitiveArrException(ja, i, NUMBER, rec.CLASS);
                    break;

                // javax.json.JsonValue.ValueType.NUMBER
                case NUMBER:

                    JsonNumber jn = (JsonNumber) jv;

                    // Guaranteed to work properly ==> This is the "definition of RJA_AEX"
                    //
                    // "numberConverter" is just Number.intValue, longValue, doubleValue
                    // Number.intValue(), longValue(), doubleValue() **DO NOT** throw any
                    // exceptions.  They round (if necessary), or return MAX_INT, MAX_LONG, etc...
                    // (also, only if necessary)

                    if (rec.RJA_AEX || rec.jsonNumWillFit.test(jn))
                        rec.a.accept(rec.numberConverter.apply(jn.numberValue()));

                    else if (rec.handlerAEX != null) rec.handlerAEX.run();

                    else throw new JsonArithmeticArrException
                        (getAEX(jn, rec.numberConverterExThrow), ja, i, NUMBER, jv, rec.CLASS);

                    break;

                // javax.json.JsonValue.ValueType.STRING
                case STRING: rec.handlerJsonString.accept(jv, i); break;

                // javax.json.JsonValue.ValueType.TRUE, FALSE, ARRAY, OBJECT
                default:
                    if (rec.handlerWrongType != null) rec.handlerWrongType.run();
                    else throw new JsonTypeArrException(ja, i, NUMBER, jv, rec.CLASS);
            }

        // Run Stream.Builder.build(); 
        return rec.b.get();
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // THREE JSON-ARRAY  ==>  JAVA-STREAM METHODS (int-stream, double-stream, long-stream)
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToStream(JsonArray, RECORD)}
     * <BR />Passes: Java {@code IntStream} Configurtion-Record
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-stream
     * <BR />For information about the {@link JFlag} parameter, click the method link above.
     * 
     * <BR /><BR />Producing a standard java {@code int[]} array from an {@code IntStream} is a
     * trivial-converstion:
     * 
     * <DIV CLASS=LOC>{@code
     * int[] arr = intArrayToStream(ja, -1, 0, null).toArray();
     * }</DIV>
     */
    public static IntStream intArrayToStream
        (JsonArray ja, int defaultValue, int FLAGS, ToIntFunction<String> optionalUserParser)
    {
        return jsonArrToStream(
            ja, RECORD.getIntStreamRec
                (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser)
        );
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToStream(JsonArray, RECORD)}
     * <BR />Passes: Java {@code LongStream} Configurtion-Record
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-stream
     * <BR />For information about the {@link JFlag} parameter, click the method link above.
     * 
     * <BR /><BR />Producing a standard java {@code long[]} array from a {@code LongStream} is a
     * trivial-converstion:
     * 
     * <DIV CLASS=LOC>{@code
     * long[] arr = longArrayToStream(ja, -1, 0, null).toArray();
     * }</DIV>
     */
    public static LongStream longArrayToStream
        (JsonArray ja, long defaultValue, int FLAGS, ToLongFunction<String> optionalUserParser)
    {
        return jsonArrToStream(
            ja, RECORD.getLongStreamRec
                (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser)
        );
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToStream(JsonArray, RECORD)}
     * <BR />Passes: Java {@code DoubleStream} Configurtion-Record
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-stream
     * <BR />For information about the {@link JFlag} parameter, click the method link above.
     * 
     * <BR /><BR />Producing a standard java {@code double[]} array from a {@code DoubleStream} is
     * a trivial-converstion:
     * 
     * <DIV CLASS=LOC>{@code
     * double[] arr = doubleArrayToStream(ja, -1, 0, null).toArray();
     * }</DIV>
     */
    public static DoubleStream doubleArrayToStream
        (JsonArray ja, double defaultValue, int FLAGS, ToDoubleFunction<String> optionalUserParser)
    {
        return jsonArrToStream(
            ja, RECORD.getDoubleStreamRec
                (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser)
        );
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // PRIMARY CONVERTER FOR STREAM OF BOXED-TYPES
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Builds a Stream of Boxed-Type Numbers from a {@link JsonArray}
     * @param rec The configurations
     * @throws JsonNullPrimitiveArrException <EMBED CLASS='external-html'
     *      DATA-FILE-ID=RARR_BS_JNPAEX>
     * @throws JsonArithmeticArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JAAEX>
     * @throws JsonStrParseArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JSPAEX>
     * @throws JsonTypeArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JTAEX>
     */
    protected static <T, U> U jsonArrToBoxedStream(JsonArray ja, RECORD<T, U> rec)
    {
        rec.c.run();    // Construct a new Stream-Builder
        rec.ja = ja;

        int SIZE = ja.size();
        JsonValue jv;

        for (int i=0; i < SIZE; i++)

            switch ((jv = ja.get(i)).getValueType())
            {
                // javax.json.JsonValue.ValueType.NULL
                case NULL: rec.handlerNull.run(); break;

                // javax.json.JsonValue.ValueType.NUMBER
                case NUMBER:

                    JsonNumber jn = (JsonNumber) jv;

                    // Guaranteed to work properly ==> This is the "definition of RJA_AEX"
                    //
                    // Number.intValue(), longValue(), doubleValue() **DO NOT** throw any
                    // exceptions.  They round (if necessary), or return MAX_INT, MAX_LONG, etc...
                    // (also, only if necessary)

                    if (rec.RJA_AEX ||  rec.jsonNumWillFit.test(jn))
                        rec.a.accept(rec.numberConverter.apply(jn.numberValue()));

                    else if (rec.handlerAEX != null) rec.handlerAEX.run();

                    else throw new JsonArithmeticArrException
                        (getAEX(jn, rec.numberConverterExThrow), ja, i, NUMBER, jv, rec.CLASS);

                    break;

                // javax.json.JsonValue.ValueType.STRING
                case STRING: rec.handlerJsonString.accept(jv, i); break;

                // OBJECT, ARRAY, TRUE, FALSE
                default:
                    if (rec.handlerWrongType != null) rec.handlerWrongType.run();
                    else throw new JsonTypeArrException(ja, i, NUMBER, jv, rec.CLASS);
            }

        // Run Stream.Builder.build()
        return rec.b.get();
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // Json-Array to Java Arrays of Primitives
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Converts a Java Boxed Stream to a Primitive Array.
     * @param <T> The generic-type of the {@code java.util.stream.Stream}
     * @param <U> The returned primitive-array type
     * @param boxedStream A Java Boxed Stream
     * @param arrayBuilder A consumer which inserts a Boxed-Number into the Primitive-Array
     * @param ja The {@link JsonArray} that generated the Boxed-Stream.  Needed for error-output
     * @param returnClass The {@code java.lang.Class} (generic-type parameter) for the
     * {@code Stream}.  In other words, the {@code Class} for type-parameter {@code <T>}.
     * This is only needed if there is an exception, for proper &amp; readable error-reporting.
     */
    protected static <T, U> U boxedStreamToPrimitiveArray(
            Stream<T>           boxedStream,
            JsonArray           ja,
            Class<T>            returnClass,
            ObjIntConsumer<T>   arrayBuilder,
            U                   retArr
        )
    {
        // Since the array-index is used inside of a LAMBDA, this "EffectivelyFinal" counter
        // class becomes necessary.

        Counter counter = new Counter(-1);

        // Don't forget, Stream's are not guaranteed to be processed in order, unless an
        // explicit request is made using something like 'forEachOrdered'

        boxedStream.forEachOrdered((T boxedPrimitive) ->
        {
            int i = counter.addOne();   // "Final, or Effectively Final"

            // A Primitive-Array (like int[], long[], boolean[] etc...) may not have null
            if (boxedPrimitive == null)
                throw new JsonNullPrimitiveArrException(ja, i, NUMBER, returnClass);

            // The 'arrayBuilder' just assigns the value to the array[i]
            arrayBuilder.accept(boxedPrimitive, i);
        });
    
        return retArr;
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #shortArrayToBoxedStream(JsonArray, short, int, Function)}
     * <BR />And: {@link #boxedStreamToPrimitiveArray(Stream, JsonArray, Class, ObjIntConsumer,
     *      Object)}
     * <BR />
     * <BR />Converts: {@link JsonArray} to {@code Stream<Short>} and then to {@code short[]}
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-array
     * <BR />
     * <BR />For information about using {@code FLAGS}, see:
     * <B>{@link #jsonArrToBoxedStream(JsonArray, RECORD)}</B>
     */
    public static short[] shortArray
        (JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<String> optionalUserParser)
    {
        short[] retArr = new short[ja.size()];

        return boxedStreamToPrimitiveArray(
            shortArrayToBoxedStream(
                // If there are any "Return null if..." JFlag's, they are eliminated
                ja, defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,

                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!
                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsShort(s)
                    : null
            ),
            ja,
            short.class,
            (Short s, int i) -> retArr[i] = s.shortValue(),
            retArr
        );
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #byteArrayToBoxedStream(JsonArray, byte, int, Function)}
     * <BR />And: {@link #boxedStreamToPrimitiveArray(Stream, JsonArray, Class, ObjIntConsumer,
     *      Object)}
     * <BR />
     * <BR />Converts: {@link JsonArray} to {@code Stream<Byte>} and then to {@code byte[]}
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-array
     * <BR />
     * <BR />For information about using {@code FLAGS}, see:
     * <B>{@link #jsonArrToBoxedStream(JsonArray, RECORD)}</B>
     */
    public static byte[] byteArray
        (JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<String> optionalUserParser)
    {
        byte[] retArr = new byte[ja.size()];

        return boxedStreamToPrimitiveArray(
            byteArrayToBoxedStream(
                // If there are any "Return null if..." JFlag's, they are eliminated
                ja, defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,

                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!
                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsByte(s)
                    : null
            ),
            ja,
            byte.class,
            (Byte s, int i) -> retArr[i] = s.byteValue(),
            retArr
        );
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #floatArrayToBoxedStream(JsonArray, float, int, Function)}
     * <BR />And: {@link #boxedStreamToPrimitiveArray(Stream, JsonArray, Class, ObjIntConsumer,
     *      Object)}
     * <BR />
     * <BR />Converts: {@link JsonArray} to {@code Stream<Float>} and then to {@code float[]}
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-array
     * <BR />
     * <BR />For information about using {@code FLAGS}, see:
     * <B>{@link #jsonArrToBoxedStream(JsonArray, RECORD)}</B>
     */
    public static float[] floatArray
        (JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<String> optionalUserParser)
    {
        float[] retArr = new float[ja.size()];

        return boxedStreamToPrimitiveArray(
            floatArrayToBoxedStream(
                // If there are any "Return null if..." JFlag's, they are eliminated
                ja, defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,

                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!
                (optionalUserParser != null)
                    ? (String s) -> optionalUserParser.applyAsFloat(s)
                    : null
            ),
            ja,
            float.class,
            (Float s, int i) -> retArr[i] = s.floatValue(),
            retArr
        );
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #booleanArrayToBoxedStream(JsonArray, boolean, int, Function)}
     * <BR />And: {@link #boxedStreamToPrimitiveArray(Stream, JsonArray, Class, ObjIntConsumer,
     *      Object)}
     * <BR />
     * <BR />Converts: {@link JsonArray} to {@code Stream<Boolean>} and then to {@code boolean[]}
     * <BR />Removes: Any {@link JFlag} masks which might insert null-entries in the return-array
     * <BR />
     * <BR />For information about using {@code FLAGS}, see:
     * <B>{@link #jsonArrToBoxedStream(JsonArray, RECORD)}</B>
     */
    public static boolean[] booleanArray(
            JsonArray ja, boolean defaultValue, int FLAGS,
            Predicate<String> optionalUserParser
        )
    {
        boolean[] retArr = new boolean[ja.size()];

        return boxedStreamToPrimitiveArray(
            booleanArrayToBoxedStream(
                // If there are any "Return null if...", they are eliminated
                ja, defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,

                // IMPORTANT, If the user didn't pass a parser, it is imperative that this is null!
                (optionalUserParser != null) ? (String s) -> optionalUserParser.test(s) : null
            ),
            ja,
            boolean.class,
            (Boolean s, int i) -> retArr[i] = s.booleanValue(),
            retArr
        );
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // Json-Array to Stream of Boxed-Number Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Integer-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Integer Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Integer[] arr = integerArrayToBoxedStream(ja, -1, 0 null).toArray(Integer[]::new);
     * }</DIV>
     */
    public static Stream<Integer> integerArrayToBoxedStream
        (JsonArray ja, int defaultValue, int FLAGS, Function<String, Integer> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getINTEGERStreamRec(defaultValue, FLAGS, optionalUserParser));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Short-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Short Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Short[] arr = shortArrayToBoxedStream(ja, -1, 0 null).toArray(Short[]::new);
     * }</DIV>
     */
    public static Stream<Short> shortArrayToBoxedStream
        (JsonArray ja, short defaultValue, int FLAGS, Function<String, Short> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getSHORTStreamRec(defaultValue, FLAGS, optionalUserParser, false));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Byte-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Byte Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Byte[] arr = byteArrayToBoxedStream(ja, -1, 0 null).toArray(Byte[]::new);
     * }</DIV>
     */
    public static Stream<Byte> byteArrayToBoxedStream
        (JsonArray ja, byte defaultValue, int FLAGS, Function<String, Byte> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getBYTEStreamRec(defaultValue, FLAGS, optionalUserParser, false));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Long-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Long Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Long[] arr = longArrayToBoxedStream(ja, -1, 0 null).toArray(Long[]::new);
     * }</DIV>
     */
    public static Stream<Long> longArrayToBoxedStream
        (JsonArray ja, long defaultValue, int FLAGS, Function<String, Long> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getLONGStreamRec(defaultValue, FLAGS, optionalUserParser));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Double-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Double Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Double[] arr = doubleArrayToBoxedStream(ja, -1, 0 null).toArray(Double[]::new);
     * }</DIV>
     */
    public static Stream<Double> doubleArrayToBoxedStream
        (JsonArray ja, double defaultValue, int FLAGS, Function<String, Double> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getDOUBLEStreamRec(defaultValue, FLAGS, optionalUserParser));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Float-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Float Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Float[] arr = floatArrayToBoxedStream(ja, -1, 0 null).toArray(Float[]::new);
     * }</DIV>
     */
    public static Stream<Float> floatArrayToBoxedStream
        (JsonArray ja, float defaultValue, int FLAGS, Function<String, Float> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getFLOATStreamRec(defaultValue, FLAGS, optionalUserParser, false));
    }

    /**
     * Convenience Method.
     * <BR />Invokes: {@link #jsonArrToBoxedStream(JsonArray, RECORD)}
     * <BR />Fills in Configuration Record for Number-Retrieval
     * <BR />For more Information about the {@link JFlag} Parameter, Click the Method-Link above.
     * <BR />
     * <BR />Producing a Boxed-Number Array from this Method is as Follows:
     * <DIV CLASS=LOC>{@code
     * Number[] arr = numberArrayToBoxedStream(ja, -1, 0 null).toArray(Number[]::new);
     * }</DIV>
     */
    public static Stream<Number> numberArrayToBoxedStream
        (JsonArray ja, Number defaultValue, int FLAGS, Function<String, Number> optionalUserParser)
    {
        return jsonArrToBoxedStream
            (ja, RECORD.getNumberStreamRec(defaultValue, FLAGS, optionalUserParser));
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // More Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Converts a {@link JsonArray} into a {@code Stream<String>}.  A Java {@code Stream<String>}
     * is easily converted to a {@code String[]}-Array via a call to:
     * 
     * <DIV CLASS=LOC>{@code
     * String[] sArr = strArrayToStream(myJsonArray, null, 0).toArray(String[]::new);
     * }</DIV>
     * 
     * @param ja Any {@code JsonArray}, but preferrably one which contains instances of
     * {@link JsonString}
     * 
     * @param defaultValue When used in conjunction with {@code 'FLAGS'}, this default-value may be
     * inserted into the output-array when error cases occur at particular array-index locations.
     * 
     * @param FLAGS Optional flags.  See {@link JFlag} for details.
     * 
     * @return A Java {@code Stream<String>}.
     */
    public static Stream<String> strArrayToStream(JsonArray ja, String defaultValue, int FLAGS)
    { return strArrayToStreamINTERNAL(ja, RECORD.getStringStreamRec(defaultValue, FLAGS)); }

    private static Stream<String> strArrayToStreamINTERNAL
        (JsonArray ja, RECORD<String, Stream<String>> rec)
    {
        int         SIZE    = ja.size();
        JsonValue   jv      = null;

        rec.c.run();    // Construct a new Stream-Builder
        rec.ja = ja;

        for (int i=0; i < SIZE; i++)

            switch ((jv = ja.get(i)).getValueType())
            {
                // javax.json.JsonValue.ValueType.NULL
                case NULL: rec.handlerNull.run(); break;

                // javax.json.JsonValue.ValueType.STRING
                case STRING: rec.a.accept(((JsonString) jv).getString()); break;

                // OBJECT, ARRAY, TRUE, FALSE, NUMBER
                default:

                    if (rec.RTS_WT) rec.a.accept(jv.toString());

                    else if (rec.handlerWrongType != null) rec.handlerWrongType.run();

                    else throw new JsonTypeArrException(ja, i, STRING, jv, String.class);
            }

        // Run Stream.Builder.build()
        return rec.b.get();
    }

    /**
     * Converts a {@link JsonArray} into a {@code Stream<Boolean>}.  A Java {@code Stream<Boolean>}
     * is easily converted to a {@code Boolean[]}-Array via a call to the lines below.  Note that
     * in this example, the return array is an array of {@code Boolean} objects; it is not a
     * primitive {@code boolean[]} array.  (To parse into a primitive array, use
     * {@link #booleanArray(JsonArray, boolean, int, Predicate)})
     * 
     * <DIV CLASS=LOC>{@code
     * Boolean[] bArr = booleanArrayToBoxedStream(myJsonArray, false, 0, null)
     *      .toArray(Boolean[]::new);
     * }</DIV>
     * 
     * @param ja Any {@code JsonArray}, but preferrably one which contains instances of
     * {@link JsonValue#TRUE} or {@link JsonValue#FALSE}
     * 
     * @param defaultValue When used in conjunction with {@code 'FLAGS'}, this default-value may be
     * inserted into the output-array when error cases occur at particular array-index locations.
     * 
     * @param FLAGS Optional flags.  See {@link JFlag} for details.
     * 
     * @param optionalUserParser If the appropriate flags are set, if a {@link JsonString} is
     * encountered while processing the {@code JsonArray}, an attempt to parse the {@code String}
     * into a {@code Boolean} will be made using this {@code String}-parser.
     * 
     * @return A Java {@code Stream<Boolean>}.
     */
    public static Stream<Boolean> booleanArrayToBoxedStream(
            JsonArray ja, boolean defaultValue, int FLAGS,
            Function<String, Boolean> optionalUserParser
        )
    {
        return booleanArrayToBoxedStreamINTERNAL(
            ja,
            RECORD.getBOOLEANStreamRec
                (defaultValue, FLAGS, optionalUserParser, false)
        );
    }

    private static Stream<Boolean> booleanArrayToBoxedStreamINTERNAL
        (JsonArray ja, RECORD<Boolean, Stream<Boolean>> rec)
    {
        int         SIZE    = ja.size();
        JsonValue   jv      = null;

        rec.c.run();    // Construct a new Stream-Builder
        rec.ja = ja;

        for (int i=0; i < SIZE; i++)

            switch ((jv = ja.get(i)).getValueType())
            {
                case NULL:      rec.handlerNull.run(); break;
                case TRUE:      rec.a.accept(true); break;
                case FALSE:     rec.a.accept(false); break;
                case STRING:    rec.handlerJsonString.accept(jv, i); break;

                // javax.json.JsonValue.ValueType.NUMBER, OBJECT, ARRAY
                default:
                    if (rec.handlerWrongType != null) rec.handlerWrongType.run();
                    else throw new JsonTypeArrException(ja, i, TRUE, jv, Boolean.class);
            }

        // Run Stream.Builder.build()
        return rec.b.get();
    }

    /**
     * Converts a {@link JsonArray} into a {@code Stream<T>}.  A Java {@code Stream<T>}
     * is easily converted to a {@code T[]}-Array via a call to the line below. 
     * 
     * <DIV CLASS=LOC>{@code
     * MyClass[] bArr = objArrayToStream(myJsonArray, null, 0, MyClass.class)
     *      .toArray(MyClass[]::new);
     * }</DIV>
     * 
     * @param <T> This is the 'type' of the array being built.  If there were a class, for example,
     * named class {@code 'Automobile'}, the value passed to parameter {@code 'returnClass'} would
     * simply be {@code Automobile.class}.
     * 
     * @param ja Any {@code JsonArray}, but preferrably one which contains instances of
     * {@link JsonValue#TRUE} or {@link JsonValue#FALSE}
     * 
     * @param defaultValue When used in conjunction with {@code 'FLAGS'}, this default-value may be
     * inserted into the output-array when error cases occur at particular array-index locations.
     * 
     * @param FLAGS Optional flags.  See {@link JFlag} for details.
     * 
     * @param returnClass The {@code java.lang.Class} of the Object being built
     * 
     * @return A Java {@code Stream<T>}.
     */
    public static <T> Stream<T> objArrayToStream
        (JsonArray ja, T defaultValue, int FLAGS, Class<T> returnClass)
    {
        return objArrayToStreamINTERNAL
            (ja, RECORD.getObjectStreamRec(defaultValue, FLAGS, returnClass));
    }

    private static <T> Stream<T> objArrayToStreamINTERNAL
        (JsonArray ja, RECORD<T, Stream<T>> rec)
    {
        int                     SIZE    = ja.size();
        JsonValue               jv      = null;

        rec.c.run();    // Construct a new Stream-Builder
        rec.ja = ja;

        for (int i=0; i < SIZE; i++)

            switch ((jv = ja.get(i)).getValueType())
            {
                // javax.json.JsonValue.ValueType.NULL
                case NULL:
                    rec.handlerNull.run();
                    break;

                // javax.json.JsonValue.ValueType.OBJECT
                case OBJECT:
                    rec.a.accept(ReadJSON.getObject(((JsonObject) jv), rec.CLASS));
                    break;

                // javax.json.JsonValue.ValueType.NUMBER, STRING, TRUE, FALSE, ARRAY
                default:
                    if (rec.handlerWrongType != null) rec.handlerWrongType.run();
                    else throw new JsonTypeArrException(ja, i, TRUE, jv, rec.CLASS);
            }

        // Run Stream.Builder.build()
        return rec.b.get();
    }

    /**
     * Parses Multi-Dimensional JSON Array's into Multi-Dimensional Java Array's.
     * 
     * <EMBED CLASS='external-html' DATA-FILE-ID=GLASS_FISH_NOTE>
     * <EMBED CLASS='external-html' DATA-FILE-ID=READ_ARR_JDIMN>
     *
     * @see Json
     * @see JsonArray
     */
    @Torello.JavaDoc.StaticFunctional
    @Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JSON_JDHBI")
    public static class DimN
    {
        private DimN() { }

        /**
         * Check user input, and throws exceptions if the array-class has not been properly
         * chosen.
         * @param retArrClass This must be a primitive-array class, possibly of multiple dimensions
         * 
         * @param rootClass The expected "root class".  For {@code int[][].class}, the root class
         * would be {@code int.class}.
         * 
         * @return Parameter {@code retArrClass} is the return value of this checker method
         * 
         * @throws IllegalArgumentExcetion If parameter {@code retArrClass}:
         * <BR /><BR /><OL CLASS=JDOL>
         * <LI>If calling {@code retArrClass.isArray()} returns {@code FALSE}</LI>
         * <LI>If the root-array type is not the appropriate type for the method that was called
         *      </LI>
         * </OL>
         */
        private static <T> Class<T> CHECK_ARRAY_CLASS(Class<T> retArrClass, Class<?> rootClass)
        {
            if (! retArrClass.isArray()) throw new IllegalArgumentException(
                "The class you have passed to parameter 'retArrClass' " +
                "[" + retArrClass.getSimpleName() + "], is not an array"
            );

            Class<?> componentClass = retArrClass.getComponentType();

            while (componentClass.isArray()) componentClass = componentClass.getComponentType();

            if (! rootClass.equals(componentClass)) throw new IllegalArgumentException(
                "The class you have passed to parameter 'retArrClass' " +
                "[" + retArrClass.getSimpleName() + "], is not a(n) " +
                rootClass.getSimpleName() + "-array."
            );

            return retArrClass;
        }

        private static Class<?> GET_ARRAY_BASE_COMPONENT_CLASS_AND_CHECK
            (Class<?> retArrClass, Object defaultValue)
        {
            if (! retArrClass.isArray()) throw new IllegalArgumentException(
                "The class you have passed to parameter 'retArrClass' " +
                "[" + retArrClass.getSimpleName() + "], is not an array"
            );

            Class<?> componentClass = retArrClass.getComponentType();

            while (componentClass.isArray()) componentClass = componentClass.getComponentType();

            if (    (defaultValue != null)
                &&  componentClass.isAssignableFrom(defaultValue.getClass())
            )

                throw new IllegalArgumentException(
                    "The User Provided Default Value of type: "+
                    "[" + defaultValue.getClass().getName() + "], cannot be assigned to the " +
                    "Component-Type of the Array: " +
                    "[" + componentClass.getName() + "]"
                );

            return componentClass;
        }



        // ****************************************************************************************
        // ****************************************************************************************
        // Primitive Multi-Dimensional Array Methods
        // ****************************************************************************************
        // ****************************************************************************************


        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code int} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code int}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * int[][] arr = ReadArrJSON.DimN.intArr(jsonArray, -1, 0, null, int[][].class);
         * }</DIV>
         */
        public static <T> T intArr(
                JsonArray ja, int defaultValue, int FLAGS,
                ToIntFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getIntStreamRec
                    (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, int.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code long} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code long}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * long[][] arr = ReadArrJSON.DimN.longArr(jsonArray, -1, 0, null, long[][].class);
         * }</DIV>
         */
        public static <T> T longArr(
                JsonArray ja, long defaultValue, int FLAGS,
                ToLongFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getLongStreamRec
                    (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, long.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code double} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code double}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * double[][] arr = ReadArrJSON.DimN.doubleArr(jsonArray, -1, 0, null, double[][].class);
         * }</DIV>
         */
        public static <T> T doubleArr(
                JsonArray ja, double defaultValue, int FLAGS,
                ToDoubleFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getDoubleStreamRec
                    (defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, double.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code short} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code short}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * short[][] arr = ReadArrJSON.DimN.shortArr(jsonArray, -1, 0, null, short[][].class);
         * }</DIV>
         */
        public static <T> T shortArr(
                JsonArray ja, short defaultValue, int FLAGS,
                ToShortFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getSHORTStreamRec(
                    defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,    
                    (optionalUserParser != null)
                        ? (String s) -> optionalUserParser.applyAsShort(s)
                        : null,
                    true
                ),
                CHECK_ARRAY_CLASS(retArrClass, short.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code byte} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code byte}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * byte[][] arr = ReadArrJSON.DimN.byteArr(jsonArray, -1, 0, null, byte[][].class);
         * }</DIV>
         */
        public static <T> T byteArr(
                JsonArray ja, byte defaultValue, int FLAGS,
                ToByteFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getBYTEStreamRec(
                    defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,    
                    (optionalUserParser != null)
                        ? (String s) -> optionalUserParser.applyAsByte(s)
                        : null,
                    true
                ),
                CHECK_ARRAY_CLASS(retArrClass, byte.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code float} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code float}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * float[][] arr = ReadArrJSON.DimN.floatArr(jsonArray, -1, 0, null, float[][].class);
         * }</DIV>
         */
        public static <T> T floatArr(
                JsonArray ja, float defaultValue, int FLAGS,
                ToFloatFunction<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getFLOATStreamRec(
                    defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,    
                    (optionalUserParser != null)
                        ? (String s) -> optionalUserParser.applyAsFloat(s)
                        : null,
                    true
                ),
                CHECK_ARRAY_CLASS(retArrClass, float.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code boolean} Configuration-RECORD
         * <BR />Removes: Any {@code FLAGS} that would produce a null array-entry
         * <BR />
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code boolean}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * boolean[][] arr = ReadArrJSON.DimN.booleanArr
         *      (jsonArray, -1, 0, null, boolean[][].class);
         * }</DIV>
         */
        public static <T> T booleanArr(
                JsonArray ja, boolean defaultValue, int FLAGS,
                Predicate<String> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getBOOLEANStreamRec(
                    defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS,    
                    (optionalUserParser != null)
                        ? (String s) -> optionalUserParser.test(s)
                        : null,
                    true
                ),
                CHECK_ARRAY_CLASS(retArrClass, boolean.class)
            );
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Boxed-Primitive Multi-Dimensional Array Methods
        // ****************************************************************************************
        // ****************************************************************************************


        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Integer} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Integer}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Integer[][] arr = ReadArrJSON.DimN.arrINTEGER(jsonArray, -1, 0, null, Integer[][].class);
         * }</DIV>
         */
        public static <T> T arrINTEGER(
                JsonArray ja, int defaultValue, int FLAGS,
                Function<String, Integer> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getINTEGERStreamRec(defaultValue, FLAGS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, Integer.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Long} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Long}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Long[][] arr = ReadArrJSON.DimN.arrLONG(jsonArray, -1, 0, null, Long[][].class);
         * }</DIV>
         */
        public static <T> T arrLONG(
                JsonArray ja, long defaultValue, int FLAGS,
                Function<String, Long> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getLONGStreamRec(defaultValue, FLAGS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, Long.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Double} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Double}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Double[][] arr = ReadArrJSON.DimN.arrDOUBLE(jsonArray, -1, 0, null, Double[][].class);
         * }</DIV>
         */
        public static <T> T arrDOUBLE(
                JsonArray ja, double defaultValue, int FLAGS,
                Function<String, Double> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getDOUBLEStreamRec(defaultValue, FLAGS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, Double.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Short} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Short}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Short[][] arr = ReadArrJSON.DimN.arrSHORT(jsonArray, -1, 0, null, Short[][].class);
         * }</DIV>
         */
        public static <T> T arrSHORT(
                JsonArray ja, short defaultValue, int FLAGS,
                Function<String, Short> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getSHORTStreamRec(defaultValue, FLAGS, optionalUserParser, true),
                CHECK_ARRAY_CLASS(retArrClass, Short.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Byte} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Byte}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Byte[][] arr = ReadArrJSON.DimN.arrBYTE(jsonArray, -1, 0, null, Byte[][].class);
         * }</DIV>
         */
        public static <T> T arrBYTE(
                JsonArray ja, byte defaultValue, int FLAGS,
                Function<String, Byte> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getBYTEStreamRec(defaultValue, FLAGS, optionalUserParser, true),
                CHECK_ARRAY_CLASS(retArrClass, Byte.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Float} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Float}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Float[][] arr = ReadArrJSON.DimN.arrFLOAT(jsonArray, -1, 0, null, Float[][].class);
         * }</DIV>
         */
        public static <T> T arrFLOAT(
                JsonArray ja, float defaultValue, int FLAGS,
                Function<String, Float> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getFLOATStreamRec(defaultValue, FLAGS, optionalUserParser, true),
                CHECK_ARRAY_CLASS(retArrClass, Float.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Boolean} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Boolean}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Boolean[][] arr = ReadArrJSON.DimN.arrBOOLEAN
         *      (jsonArray, false, 0, null, Boolean[][].class);
         * }</DIV>
         */
        public static <T> T arrBOOLEAN(
                JsonArray ja, boolean defaultValue, int FLAGS,
                Function<String, Boolean> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getBOOLEANStreamRec(defaultValue, FLAGS, optionalUserParser, true),
                CHECK_ARRAY_CLASS(retArrClass, Boolean.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Number} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Number}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * Number[][] arr = ReadArrJSON.DimN.arrNumber(jsonArray, -1, 0, null, Number[][].class);
         * }</DIV>
         */
        public static <T> T arrNumber(
                JsonArray ja, Number defaultValue, int FLAGS,
                Function<String, Number> optionalUserParser, Class<T> retArrClass
            )
        {
            return jsonArrToJavaArr(
                ja,
                RECORD.getNumberStreamRec(defaultValue, FLAGS, optionalUserParser),
                CHECK_ARRAY_CLASS(retArrClass, Number.class)
            );
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // Non-Primitive Multi-Dimensional Array Methods
        // ****************************************************************************************
        // ****************************************************************************************


        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code String} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code String}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * String[][] arr = ReadArrJSON.DimN.strArr(jsonArray, null, 0, String[][].class);
         * }</DIV>
         */
        public static <T> T strArr
            (JsonArray ja, String defaultValue, int FLAGS, Class<T> retArrClass)
        {
            return jsonArrToJavaArr(
                ja, 
                RECORD.getStringStreamRec(defaultValue, FLAGS),
                CHECK_ARRAY_CLASS(retArrClass, String.class)
            );
        }

        /**
         * Convenience Method.
         * <BR />Invokes: {@link #jsonArrToJavaArr(JsonArray, ReadArrJSON.RECORD, Class)}
         * <BR />Passes: {@code Object} Configuration-RECORD
         * <BR />See link above for more {@link JFlag} explanations.
         * <BR /><B>NOTE:</B> {@code retArrClass} must be a multi-dimensinal {@code Object}-array.
         * <BR />(See last <B>"return-type"</B> parameter in example below)
         * 
         * <DIV CLASS=LOC>{@code
         * MyClass[][] arr = ReadArrJSON.DimN.strArr(jsonArray, null, 0, MyClass[][].class);
         * }</DIV>
         */
        @SuppressWarnings({"rawtypes", "unchecked"})
        public static <T, U> T objArr
            (JsonArray ja, Object defaultValue, int FLAGS, Class<T> retArrClass)
        {
            Class baseClass = // (Class<U>)
                GET_ARRAY_BASE_COMPONENT_CLASS_AND_CHECK(retArrClass, defaultValue);

            return jsonArrToJavaArr
                (ja, RECORD.getObjectStreamRec(baseClass.cast(defaultValue), FLAGS, baseClass), retArrClass);
        }


        // ****************************************************************************************
        // ****************************************************************************************
        // The General Purpose Transformer Method
        // ****************************************************************************************
        // ****************************************************************************************


        /**
         * The array processor for this class.  Handles all multi-dimensional array processing
         * requests.
         * 
         * @param <T> The array type being returned.  This {@code java.lang.Class} must be an
         * array-class.
         * 
         * @param ja Any {@link JsonArray}
         * @param rec The Configuration-Record
         * @param retArrClass The class of the return array type.
         * 
         * @return An array of type {@code T}
         * 
         * @throws JsonNullPrimitiveArrException <EMBED CLASS='external-html'
         *      DATA-FILE-ID=RARR_BS_JNPAEX>
         * @throws JsonArithmeticArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JAAEX>
         * @throws JsonStrParseArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JSPAEX>
         * @throws JsonTypeArrException <EMBED CLASS='external-html' DATA-FILE-ID=RARR_BS_JTAEX>
         */
        @SuppressWarnings("unchecked")
        protected static <T> T jsonArrToJavaArr
            (JsonArray ja, RECORD<?, ?> rec, Class<T> retArrClass)
        {
            // If this is requesting a one-dimensional array, get it using the 1D-Generator,
            // and simply return that array.  This requires a cast because there is no way to prove
            // to the Java-Compiler that <T> is equal to any return-value at all.
            //
            // Remember that this is only guaranteed (it works!) because the helper methods are all
            // protected or private, and it has been guaranteed through rigorous testing, and
            // preventing the user from playing with it!

            if (StringParse.countCharacters(retArrClass.getSimpleName(), '[') == 1)
                return (T) rec.array1DGenerator.apply(ja);

            // Otherwise, this is not a single-dimension (1D) array.  Instead, the JsonArray needs
            // to be iterated, and this method called, recursively, on each of the sub-arrays.
            //
            // NOTE: 'compClass' will also be an array, but with one fewer dimensions

            Class<?>    compClass   = retArrClass.getComponentType();
            int         SIZE        = ja.size();
            T           retArr      = (T) Array.newInstance(compClass, SIZE);
            JsonValue   jv          = null;

            for (int i=0; i < SIZE; i++)

                switch ((jv = ja.get(i)).getValueType())
                {
                    // javax.json.JsonValue.ValueType.NULL
                    case NULL: Array.set(retArr, i, null); break;

                    // javax.json.JsonValue.ValueType.ARRAY (JsonArray)
                    case ARRAY:
                        Array.set
                            (retArr, i, jsonArrToJavaArr((JsonArray) jv, rec, compClass));
                        break;

                    // javax.json.JsonValue.ValueType.TRUE, FALSE, NUMBER, STRING, OBJECT
                    default:
                        if (rec.IN_NSAT)        Array.set(retArr, i, null);
                        else if (rec.S_NSAT)    continue;
                        else throw new JsonTypeArrException(ja, i, ARRAY, jv, retArrClass);
                }

            return retArr;
        }
    }
}