1
zj
2024-06-13 8eea5be3b36875bd4ffe70e6c3a5bb07b1d829bf
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
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
package com.yami.trading.common.util;
 
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
 
/**
 * @author JORGE
 * 通用工具集
 */
@SuppressWarnings({"unchecked","rawtypes"})
public class CommonUtil {
    /**
     * 类对象类型(类类型、接口类型、所有类型)
     */
    public static enum ClassType{CLASS,FACE,ALL}
    
    /**
     * 逗号正则式
     */
    public static final Pattern COMMA=Pattern.compile(",");
    
    /**
     * 空白分隔符
     */
    public static final Pattern BLANK=Pattern.compile("\\s+");
    
    /**
     * 短横线正则式
     */
    public static final Pattern DASH_HUMP=Pattern.compile("-|_");
    
    /**
     * 点号正则式
     */
    public static final Pattern DOT_REGEX = Pattern.compile("\\.");
    
    /**
     * 基本类型到包装类型映射字典
     */
    public static final HashMap<Class<?>,Class<?>> BASE_TO_WRAP;
    
     /**
     * 单双引号集合
     */
    public static final List<Character> QUOTATIONS=Arrays.asList('\'','"');
    
    /**
     * 键值分隔符正则式
     */
    public static final Pattern KEYVAL_SEPARATOR=Pattern.compile(":|=");
    
    /**
     * 元素分隔符正则式
     */
    public static final Pattern ELEMENT_SEPARATOR=Pattern.compile(",|;");
    
    /**
     * 整数正则式
     */
    public static final Pattern INTEGER_CHARACTER=Pattern.compile("[0-9]+");
    
    /**
     * 数字正则式
     */
    public static final Pattern NUMBER_CHARACTER=Pattern.compile("[0-9.]+");
    
    /**
     * 字母正则式
     */
    public static final Pattern LETTER_CHARACTER=Pattern.compile("[a-zA-Z]+");
    
    /**
     * 单词正则式
     */
    public static final Pattern WORD_CHARACTER=Pattern.compile("[a-zA-Z0-9_]+");
    
    /**
     * 中文(汉字)正则式
     */
    public static final Pattern CHINESE_CHARACTER=Pattern.compile("[\u4e00-\u9fa5]+");
    
    /**
     * JSON工具类
     */
    public static final String JSON_UTIL_CLASS="com.fasterxml.jackson.databind.ObjectMapper";
    
    /**
     * 方法签名正则式
     */
    public static final Pattern METHOD_SIGNATURE=Pattern.compile("([a-z_$A-Z]+[0-9]*)[\\s]*\\((.*)\\)");
    
    static{
        BASE_TO_WRAP=new HashMap<Class<?>,Class<?>>();
        BASE_TO_WRAP.put(byte.class, Byte.class);
        BASE_TO_WRAP.put(short.class, Short.class);
        BASE_TO_WRAP.put(int.class, Integer.class);
        BASE_TO_WRAP.put(long.class, Long.class);
        BASE_TO_WRAP.put(float.class, Float.class);
        BASE_TO_WRAP.put(double.class, Double.class);
        BASE_TO_WRAP.put(boolean.class, Boolean.class);
        BASE_TO_WRAP.put(char.class, Character.class);
        BASE_TO_WRAP.put(void.class, Void.class);
    }
    
    /**
     * 指定类型是否为基本类型
     * @param type 类型
     * @return 是否为8种基本类型
     */
    public static boolean isBaseType(Class<?> type){
        return type.isPrimitive();
    }
    
    /**
     * 指定类型是否为包装类型
     * @param type 类型
     * @return 是否为8种包装类型
     */
    public static boolean isWrapType(Class<?> type){
        return BASE_TO_WRAP.containsValue(type);
    }
    
    /**
     * 指定类型是否为日期类型
     * @param type 类型
     * @return 是否为日期类型
     */
    public static boolean isDateType(Class<?> type){
        return Date.class.isAssignableFrom(type) || Calendar.class.isAssignableFrom(type);
    }
    
    /**
     * 指定类型是否为简单类型
     * @param type 类型
     * @return 是否为三类简单类型
     * @description
     * 简单类型包括8中基本类型、8种包装类型、字符串类型和日期类型
     */
    public static boolean isSimpleType(Class<?> type){
        if(isBaseType(type) || isWrapType(type) || String.class.isAssignableFrom(type)) return true;
        if(Date.class.isAssignableFrom(type) || Calendar.class.isAssignableFrom(type)) return true;
        return false;
    }
    
    /**
     * 指定类型是否为集合类型
     * @param type 类型
     * @return 是否为集合类型
     */
    public static boolean isCollectionType(Class<?> type){
        if(Collection.class.isAssignableFrom(type)) return true;
        if(Map.class.isAssignableFrom(type)) return true;
        return false;
    }
    
    /**
     * 指定类型是否为数字类型
     * @param type 类型
     * @return 是否为数字类型
     */
    public static boolean isNumber(Class<?> type){
        if(Number.class.isAssignableFrom(type)) return true;
        if(boolean.class==type || char.class==type || void.class==type) return false;
        return BASE_TO_WRAP.containsKey(type);
    }
    
    /**
     * 指定字串是否为整数串
     * @param type 类型
     * @return 是否为整数串
     */
    public static boolean isInteger(String string){
        if(isEmpty(string)) return false;
        return INTEGER_CHARACTER.matcher(string).matches();
    }
    
    /**
     * 指定字串是否为纯数字串
     * @param type 类型
     * @return 是否为纯数字串
     */
    public static boolean isNumber(String string){
        if(isEmpty(string)) return false;
        return NUMBER_CHARACTER.matcher(string).matches();
    }
    
    /**
     * 指定字串是否为纯字母串
     * @param type 类型
     * @return 是否为纯字母串
     */
    public static boolean isLetter(String string){
        if(isEmpty(string)) return false;
        return LETTER_CHARACTER.matcher(string).matches();
    }
    
    /**
     * 指定字串是否为纯汉字串
     * @param source 字符串
     * @return 是否为纯汉字串
     */
    public static boolean isUnicode(String string){
        if(isEmpty(string)) return false;
        return CHINESE_CHARACTER.matcher(string).matches();
    }
    
    /**
     * 指定字串是否为纯单词串
     * @param source 字符串
     * @return 是否为纯单词串
     */
    public static boolean isWord(String string){
        if(isEmpty(string)) return false;
        return WORD_CHARACTER.matcher(string).matches();
    }
    
        /**
         * 判断给定的字串是否包含数字
         * @param utfString 源串
         * @return 是否包含数字
         */
        public static boolean containsNumber(String utfString){
            return NUMBER_CHARACTER.matcher(utfString).find();
        }
        
        /**
         * 判断给定的字串是否包含字母
         * @param utfString 源串
         * @return 是否包含字母
         */
        public static boolean containsLetter(String utfString){
            return LETTER_CHARACTER.matcher(utfString).find();
        }
        
        /**
         * 判断给定的字串是否包含汉字
         * @param utfString 源串
         * @return 是否包含汉字
         */
        public static boolean containsCNChar(String utfString){
            return CHINESE_CHARACTER.matcher(utfString).find();
        }
        
         /**
         * 判定给定的字符串是否包含Unicode字符
         * @param utfString 源串
         * @return 是否包含Unicode字符
         */
        public static boolean containsUnicode(String utfString){
            return -1==utfString.indexOf("\\u")?false:true;
        }
        
        /**
         * 判断指定的参数类型是否为泛型参数
         * @param type 参数类型
         * @return 是否为泛型参数
         */
        public static boolean isGeneric(Type type){
            return (null==type||Class.class.isInstance(type))?false:true;
        }
        
        /**
         * 获取类型可能对应的包装类型
         * @param type 参考类型
         * @return 包装类型
         */
        public static Class<?> getWrapType(Class<?> type){
            if(null==type) return null;
            if(!type.isPrimitive()) return type;
            return BASE_TO_WRAP.get(type);
        }
        
        /**
         * 获取操作系统类型
         * @return 系统类型
         */
        public static String getOSType(){
            String osType=System.getProperty("os.name");
            if(null==osType || 0==osType.trim().length()) return null;
            String[] osInfo=BLANK.split(osType.trim());
            if(0==osInfo.length) return null;
            return upperFirstChar(osInfo[0]);
        }
        
        /**
         * 获取操作系统版本
         * @return 系统版本
         */
        public static String getOSVersion(){
            return System.getProperty("os.version");
        }
        
        /**
         * 获取处理器架构
         * @return 系统架构
         */
        public static String getCPUArch(){
            return System.getProperty("os.arch");
        }
        
        /**
         * 获取类中成员是否携带泛型
         * @param member 类的成员
         * @return 成员是否携带泛型
         * @description 泛型集合成员返回true,数组和其它成员返回false
         */
        public static boolean hasGeneric(Member member){
            return isGeneric(getGeneric(member));
        }
        
        /**
         * 获取类中成员的泛型类型
         * @param member 成员字段(Field)或成员方法(Method)
         * @return 泛型类型
         * @description 若成员携带泛型参数,则返回成员参数类型,否则返回成员自身类型
         */
        public static Type getGeneric(Member member){
            if(null==member) return null;
            if(Field.class.isInstance(member)) return ((Field)member).getGenericType();
            if(Method.class.isInstance(member)) return ((Method)member).getGenericReturnType();
            return null;
        }
        
        /**
         * 获取类中成员(字段(Field)或方法(Method))携带的泛型参数类型
         * @param member 类中成员
         * @return 泛型类型
         * @description 字段泛化参数类型或方法返回泛化参数类型
         */
        public static Class<?>[] getGenericClass(Member member){
            Type type=getGeneric(member);
            if(!isGeneric(type)) return null;
            Type[] classParams=((ParameterizedType)type).getActualTypeArguments();
            if(null==classParams || 0==classParams.length) return null;
            Object newArray=Array.newInstance(Class.class, classParams.length);
            System.arraycopy(classParams, 0, newArray, 0, classParams.length);
            return (Class<?>[])newArray;
        }
        
        /**
         * 获取成员方法的泛型参数类型
         * @param method 成员方法
         * @return 泛型参数类型表
         * @description 返回方法中每个参数类型的泛化类型列表
         * 返回列表中的每一个数组代表对应参数项的泛型类型表(每一个参数可以携带多个泛型类型)
         */
        public static ArrayList<Class<?>[]> getGenericParamClass(Method method){
            if(null==method) return null;
            Type[] types=method.getGenericParameterTypes();
            ArrayList<Class<?>[]> paramGenericTypes=new ArrayList<Class<?>[]>();
            
            for(int i=0;i<types.length;i++){
                if(!isGeneric(types[i])) {
                    paramGenericTypes.add(null);
                    continue;
                }
                
                Type[] classParams=((ParameterizedType)types[i]).getActualTypeArguments();
                if(null==classParams || 0==classParams.length) {
                    paramGenericTypes.add(null);
                    continue;
                }
                
                Object newArray=Array.newInstance(Class.class, classParams.length);
                System.arraycopy(classParams, 0, newArray, 0, classParams.length);
                paramGenericTypes.add((Class<?>[])newArray);
            }
            
            return paramGenericTypes;
        }
        
        /**
         * 读取输入流中的一行记录并返回读取的行记录
         * @param inputStream 输入流
         * @param bufferSize 缓冲尺寸
         * @return 实际读取数据行
         * @throws IOException
         */
        public static String readLine(InputStream inputStream,Integer... bufferSize) throws IOException{
            byte[] b=readBytes(inputStream,bufferSize);
            if(null==b) return null;
            return new String(b).trim();
        }
        
        /**
         * 读取输入流中的一行记录并返回读取的字节数组
         * @param inputStream 输入流
         * @param bufferSize 缓冲尺寸
         * @return 实际读取的字节数组(含换行符和回车符)
         * @throws IOException
         */
        public static byte[] readBytes(InputStream inputStream,Integer... bufferSize) throws IOException{
            int size=null==bufferSize || 0==bufferSize.length?32768:null==bufferSize[0]?32768:bufferSize[0];
            int k=inputStream.read();
            if(-1==k) return null;
            
            int i=0;
            byte[] b=new byte[size];
            b[i++]=(byte)k;
            
            for(k=inputStream.read();k!=-1;k=inputStream.read()){
                byte kk=(byte)k;
                b[i++]=kk;
                if(10==kk || 13==kk) break;
            }
            
            byte[] retByte=new byte[i];
            System.arraycopy(b, 0, retByte, 0, i);
            return retByte;
        }
        
        /**
         * 转换数组的元素类型
         * @param array 原数组
         * @param componentType 新数组的组件类型
         * @return 新组件类型的数组
         * @description 
         * 与asArray的区别在于srcArray如果是非数组类型的情况下,本方法直接返回原值srcArray,
         * 而asArray则将srcArray包装成一个数组返回(asArray总是返回一个数组),如果srcArray为数组类型则两者行为一致(本质上均返回数组)
         */
        public static <E> Object transferArray(Object srcArray,Class<E> newComType){
            if(null==srcArray) return null;
            if(null==newComType) return srcArray;
            if(!srcArray.getClass().isArray()) return srcArray;
            
            int arrayLen=Array.getLength(srcArray);
            Object newArray=Array.newInstance(newComType, arrayLen);
            for(int i=0;i<arrayLen;Array.set(newArray, i, transferType(Array.get(srcArray, i),newComType)),i++);
            return newArray;
        }
        
        /**
         * 数字类型间相互转换
         * @param value 被转换的数字值
         * @param returnType 转换到的目标数字类型
         * @return 目标数字类型
         */
        public static <R> R stringToNumber(String value,Class<R> returnType){
            BigDecimal maxVal=new BigDecimal(value);
            Number number=null;
            
            if(int.class==returnType || Integer.class==returnType){
                number=maxVal.intValue();
            }else if(long.class==returnType || Long.class==returnType){
                number=maxVal.longValue();
            }else if(double.class==returnType || Double.class==returnType){
                number=maxVal.doubleValue();
            }else if(float.class==returnType || Float.class==returnType){
                number=maxVal.floatValue();
            }else if(byte.class==returnType || Byte.class==returnType) {
                number=maxVal.byteValue();
            }else if(short.class==returnType || Short.class==returnType){
                number=maxVal.shortValue();
            }else if(BigInteger.class==returnType){
                number=BigInteger.valueOf(maxVal.longValue());
            }else if(BigDecimal.class==returnType){
                number=maxVal;
            }else if(AtomicInteger.class==returnType){
                number=new AtomicInteger(maxVal.intValue());
            }else if(AtomicLong.class==returnType){
                number=new AtomicLong(maxVal.longValue());
            }
            
            return (R)number;
        }
        
        /**
         * 将对象转换到指定的类型(本方法堪称为万能类型转换法)
         * @param value 待转换的对象
         * @param returnType 转换到的目标类型
         * @param elementTypes 目标集合中的元素类型
         * @return 目标类型对象
         */
        public static <R,E> R transferType(Object value,Class<R> returnType,Class<E>... elementTypes){
            return transferType(value,returnType,null,elementTypes);
        }
        
        /**
         * 将对象转换到指定的类型(本方法堪称为万能类型转换法)
         * @param value 待转换的对象
         * @param returnType 转换到的目标类型
         * @param elementTypes 目标集合中的元素类型
         * @return 目标类型对象
         */
        public static <R,E> R transferType(Object value,Class<R> returnType,Class<?> keyType,Class<E>... elementTypes){
            if(null==value || null==returnType) return null;
            Class<?> valueType=value.getClass();
            if(compatible(returnType,valueType)) return (R)value;
            try {
                return objectToType(value,returnType,keyType,elementTypes);
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
        
        /**
         * 判断给定的基类型superType是否可以兼容到指定的子类型childType
         * @param superType 基类型
         * @param childType 子类型
         * @return 是否兼容
         */
        public static boolean compatible(Class<?> superType,Class<?> childType){
            if(superType==childType) return true;
            if(null==superType && null!=childType) return false;
            if(null!=superType && null==childType) return false;
            if(superType.isAssignableFrom(childType)) return true;
            try{
                if(superType.isPrimitive() && superType==childType.getField("TYPE").get(null)) return true;
                if(childType.isPrimitive() && childType==superType.getField("TYPE").get(null)) return true;
                return false;
            }catch(Exception e){
                return false;
            }
        }
        
        /**
         * 判断给定的基类型superTypes数组是否可以兼容到指定的子类型数组childTypes
         * @param superTypes 基类型
         * @param childTypes 子类型
         * @return 数组类型是否兼容
         */
        public static boolean compatible(Class<?>[] superTypes,Class<?>[] childTypes){
            if(superTypes==childTypes) return true;
            if(null==superTypes && null!=childTypes) return false;
            if(null!=superTypes && null==childTypes) return false;
            if(superTypes.length!=childTypes.length) return false;
            try{
                for(int i=0;i<superTypes.length;i++){
                    if(superTypes[i]==childTypes[i] || superTypes[i].isAssignableFrom(childTypes[i])) continue;
                    if(superTypes[i].isPrimitive() && superTypes[i]==childTypes[i].getField("TYPE").get(null)) continue;
                    if(childTypes[i].isPrimitive() && childTypes[i]==superTypes[i].getField("TYPE").get(null)) continue;
                    return false;
                }
                return true;
            }catch(Exception e){
                return false;
            }
        }
        
        /**
         * 将ASCII码数组中的每个元素值转换成对应的字符
         * @param asciis 源ASCII数组
         * @return 字符串
         */
        public static String asciiToChar(int... asciis){
            if(null==asciis||0==asciis.length) return null;
            StringBuilder builder=new StringBuilder();
            for (int i=0; i<asciis.length;builder.append((char)asciis[i]),i++);
            return builder.toString();
        }
        
        /**
         * 将字串中每个字符转换成对应的ASCII码
         * @param utfString 源串
         * @return ASCII码数组
         */
        public static int[] charToAscii(String utfString){
            if(null==utfString||utfString.isEmpty()) return null;
            char[] chars = utfString.toCharArray();
            int[] asciis=new int[chars.length];
            for (int i=0; i<chars.length;asciis[i]=(int)chars[i],i++);
            return asciis;
        }
        
        /**
         * 将中文字串转换为Unicode编码
         * @param utfString 源字符串
         * @return Unicode字符串
         */
        public static String encodeToUnicode(String utfString) {
            if(isEmpty(utfString)) return utfString;
            char[] utfChars = utfString.toCharArray();
            StringBuilder charBuilder = new StringBuilder("");
            for (int i = 0; i<utfChars.length; i++) {
                String hexChar = Integer.toHexString(utfChars[i]);
                charBuilder.append("\\u");
                if(2<hexChar.length()){
                    charBuilder.append(hexChar);
                    continue;
                }
                charBuilder.append("00").append(hexChar);
            }
            return charBuilder.toString();
        }
         
        /**
         * 将Unicode编码转换为中文字串
         * @param unicode Unicode编码
         * @return 中文字串
         */
        public static String decodeFromUnicode(String unicode) {
            if(isEmpty(unicode)) return unicode;
            StringBuilder builder = new StringBuilder();
            for (int start=0,end=0;-1!=start;start=end) {
                end = unicode.indexOf("\\u", start+2);
                if (end != -1)  {
                    builder.append((char)Integer.parseInt(unicode.substring(start+2, end), 16));
                    continue;
                }
                builder.append((char)Integer.parseInt(unicode.substring(start+2, unicode.length()), 16));
            }
            return builder.toString();
        }
        
    /**
     * 将ISO8859-1字符集转换为UTF-8字符集
     * @param unicode 源字串
     * @return UTF8字串
     */
    public static String ios8859ToUtf8(String unicode) {
        return srcCharsetToDstCharset(unicode,"ISO8859-1","UTF-8");
    }
    
    /**
     * 将字串由srcCharset字符集转换为dstCharset字符集
     * @param unicode 源字串
     * @param srcCharset 源字符集
     * @param dstCharset 目标字符集
     * @return dstCharset字串
     */
    public static String srcCharsetToDstCharset(String unicode,String srcCharset,String dstCharset) {
        try {
            return new String(unicode.getBytes(srcCharset),dstCharset);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
    
    /**
     * 指定的参数字串是否为字典JSON
     * @param src 源串
     * @return 是否为非字典JSON
     */
    public static boolean isNotDictJson(String src) {
        if(null==src) return true;
        if((src=src.trim()).isEmpty()) return true;
        return !src.startsWith("{") || !src.endsWith("}");
    }
    
    /**
     * 指定的参数字串是否为列表JSON
     * @param src 源串
     * @return 是否为非列表JSON
     */
    public static boolean isNotListJson(String src) {
        if(null==src) return true;
        if((src=src.trim()).isEmpty()) return true;
        return !src.startsWith("[") || !src.endsWith("]");
    }
    
    /**
     * 指定的参数字串是否为JSON
     * @param src 源串
     * @return 是否为非JSON
     */
    public static boolean isNotJson(String src) {
        if(null==src) return true;
        if((src=src.trim()).isEmpty()) return true;
        return isNotDictJson(src) && isNotListJson(src);
    }
    
    /**
     * 将JAVA对象转换为JSON对象
     * @param object JAVA对象
     * @return JSON对象
     */
    public static Object toJSON(Object object) {
        if(null==object) return null;
        Class<?> type=object.getClass();
        if(char.class==type || Character.class==type) return object.toString();
        if(Date.class.isAssignableFrom(type)) return DateUtil.dateToString((Date)object);
        if(isBaseType(type) || isWrapType(type) || String.class.isAssignableFrom(type)) return object;
        if(Calendar.class.isAssignableFrom(type)) return DateUtil.calendarToString((Calendar)object);
        if(type.isArray()) {
            Object[] arr=new Object[Array.getLength(object)];
            for(int i=0;i<arr.length;arr[i]=toJSON(Array.get(object,i++)));
            return arr;
        }else if(Iterable.class.isAssignableFrom(type)) {
            ArrayList<Object> list=new ArrayList<Object>();
            for(Object ele:((Iterable)object)) list.add(toJSON(ele));
            return list;
        }else if(Map.class.isAssignableFrom(type)) {
            HashMap<String,Object> map=new HashMap<String,Object>();
            for(Entry<Object, Object> entry:((Map<Object, Object>)object).entrySet()){
                Object keyObj=entry.getKey();
                Object valueObj=entry.getValue();
                if(null==keyObj || null==valueObj) continue;
                String key=keyObj.toString().trim();
                if(key.isEmpty()) continue;
                map.put(key, toJSON(valueObj));
            }
            return map;
        }else{
            HashMap<String,Object> map=new HashMap<String,Object>();
            HashMap<String, Field> fieldDict=findFields(type);
            try{
                for(Entry<String, Field> entry:fieldDict.entrySet()){
                    String fieldName=entry.getKey();
                    Field field=entry.getValue();
                    if(null==fieldName || null==field) continue;
                    String key=fieldName.toString().trim();
                    Object fieldValue=field.get(object);
                    if(null==fieldValue || key.isEmpty()) continue;
                    map.put(key, toJSON(fieldValue));
                }
            }catch(Exception e) {
                throw new RuntimeException(e);
            }
            return map;
        }
    }
    
    /**
     * 将对象转换为字符串描述
     * @description 格式化Object类中的toString方法
     * @param object 对象
     * @return 字符串
     */
    public static String toString(Object object) {
        Object json=toJSON(object);
        if(null==json) return null;
        Class<?> jsonType=json.getClass();
        if(isSimpleType(jsonType)) return json.toString().trim();
        return javaToJsonStr(json).trim();
    }
    
    /**
     * 将数组对象转换为对象数组
     * @param array 数组对象
     * @return 对象数组
     */
    public static Object[] asArray(Object array) {
        return asArray(array,Object.class);
    }
    
    /**
     * 将数组对象转换为基本字节数组
     * @param array 数组对象
     * @return 字节数组
     */
    public static byte[] asByteArray(Object array) {
        Byte[] k1=asArray(array,Byte.class);
        byte[] k2=new byte[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本短整型数组
     * @param array 数组对象
     * @return 短整型数组
     */
    public static short[] asShortArray(Object array) {
        Short[] k1=asArray(array,Short.class);
        short[] k2=new short[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本整型数组
     * @param array 数组对象
     * @return 整型数组
     */
    public static int[] asIntArray(Object array) {
        Integer[] k1=asArray(array,Integer.class);
        int[] k2=new int[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本长整型数组
     * @param array 数组对象
     * @return 长整型数组
     */
    public static long[] asLongArray(Object array) {
        Long[] k1=asArray(array,Long.class);
        long[] k2=new long[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本浮点型数组
     * @param array 数组对象
     * @return 浮点型数组
     */
    public static float[] asFloatArray(Object array) {
        Float[] k1=asArray(array,Float.class);
        float[] k2=new float[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本实数型数组
     * @param array 数组对象
     * @return 实数型数组
     */
    public static double[] asDoubleArray(Object array) {
        Double[] k1=asArray(array,Double.class);
        double[] k2=new double[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本字符型数组
     * @param array 数组对象
     * @return 字符型数组
     */
    public static char[] asCharArray(Object array) {
        Character[] k1=asArray(array,Character.class);
        char[] k2=new char[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为基本布尔型数组
     * @param array 数组对象
     * @return 布尔型数组
     */
    public static boolean[] asBooleanArray(Object array) {
        Boolean[] k1=asArray(array,Boolean.class);
        boolean[] k2=new boolean[k1.length];
        for(int i=0;i<k1.length;k2[i]=k1[i],i++);
        return k2;
    }
    
    /**
     * 将数组对象转换为对象数组
     * @param array 数组对象
     * @param elementType 数组元素类型(不能是基本类型)
     * @return 泛化数组
     */
    public static <E> E[] asArray(Object array,Class<E> elementType) {
         Object newArray=null;
         if (null==array) return null;
        
         if(!array.getClass().isArray()) {
             newArray=Array.newInstance(elementType, 1);
             Array.set(newArray,0, transferType(array,elementType));
         } else{
             int length = Array.getLength(array);
             newArray=Array.newInstance(elementType, length);
             for(int i=0;i<length;Array.set(newArray, i, transferType(Array.get(array, i),elementType)),i++);
         }
         
         return (E[])newArray;
      }
    
    /**
     * 字符串转换为字串数组(默认使用逗号分隔符)
     * @param src 源串
     * @param separators 分隔符
     * @return 字串数组
     */
    public static String[] splitToArray(String src,String... separators){
        if(isEmpty(src)) return null;
        if(isEmpty(separators)) return COMMA.split(src);
        return src.split(separators[0]);
    }
    
    /**
     * 字符串转换为字串列表(默认使用逗号分隔符)
     * @param src 源串
     * @param separators 分隔符
     * @return 字串列表
     */
    public static List<String> splitToList(String src,String... separators){
        if(isEmpty(src)) return null;
        String[] array=splitToArray(src);
        return Arrays.asList(array);
    }
    
    /**
     * 字串数组串联成字符串(默认使用空串连接)
     * @param src 源字串数组
     * @param separators 分隔符
     * @return 字符串
     */
    public static String joinToString(String[] srcs,String... separators){
        if(isEmpty(srcs)) return null;
        StringBuilder builder=new StringBuilder();
        if(isEmpty(separators)) {
            for(int i=0;i<srcs.length;builder.append(srcs[i++]));
            return builder.toString();
        }
        for(int i=0;i<srcs.length;builder.append(srcs[i++]).append(separators[0]));
        if(builder.length()>0) builder.deleteCharAt(builder.length()-1);
        return builder.toString();
    }
    
    /**
     * 字串列表串联成字符串(默认使用空串连接)
     * @param src 源字串列表
     * @param separators 分隔符
     * @return 字符串
     */
    public static String joinToString(List<String> srcs,String... separators){
        if(isEmpty(srcs)) return null;
        String[] srcArray=srcs.toArray(new String[srcs.size()]);
        return joinToString(srcArray,separators);
    }
    
    /**
     * 将字符串按"key1=val1,key2=val2..."格式解析为字典
     * @param src 源串
     * @return 字典
     */
    public static HashMap<String,String> parseToMap(String src){
        HashMap<String,String> map=new HashMap<String,String>();
        String[] array=ELEMENT_SEPARATOR.split(src);
        for(String ele:array){
            String[] entry=KEYVAL_SEPARATOR.split(ele);
            if(2>entry.length) continue;
            map.put(entry[0].trim(), entry[1].trim());
        }
        return map;
    }
    
    /**
     * 将字符串按指定分隔符解析为字典
     * @param src 源串
     * @param eleSeparator 元素分隔符
     * @param keyvalSeparator 键值分隔符
     * @return 字典
     */
    public static HashMap<String,String> parseToMap(String src,String eleSeparator,String keyvalSeparator){
        HashMap<String,String> map=new HashMap<String,String>();
        String[] array=src.split(eleSeparator);
        for(String ele:array){
            String[] entry=ele.split(keyvalSeparator);
            if(2>entry.length) continue;
            map.put(entry[0].trim(), entry[1].trim());
        }
        return map;
    }
    
    /**
     * 将字符串按"key1=val1,key2=val2..."格式解析为字典
     * @param src 源串
     * @param separators 分隔符
     * @return 字典
     */
    public static <R> R parseToEntity(String src,Class<R> entityType){
        String[] array=ELEMENT_SEPARATOR.split(src);
        try {
            R r = entityType.newInstance();
            for(String ele:array){
                String[] entry=KEYVAL_SEPARATOR.split(ele);
                if(2>entry.length) continue;
                Field field=findField(entityType, entry[0].trim());
                Object fieldValue=transferType(entry[1].trim(), field.getType());
                field.set(r, fieldValue);
            }
            return r;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    /**
     * 将字符串按指定分隔符解析为字典
     * @param src 源串
     * @param separators 分隔符
     * @return 字典
     */
    public static <R> R parseToEntity(String src,Class<R> entityType,String eleSeparator,String keyvalSeparator){
        String[] array=src.split(eleSeparator);
        try {
            R r = entityType.newInstance();
            for(String ele:array){
                String[] entry=ele.split(keyvalSeparator);
                if(2>entry.length) continue;
                Field field=findField(entityType, entry[0].trim());
                Object fieldValue=transferType(entry[1].trim(), field.getType());
                field.set(r, fieldValue);
            }
            return r;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    /**
     * 将字节输入流转换为缓冲字符输入流
     * @param inStream 字节流
     * @return 缓冲字符流
     */
    public static BufferedReader getBufferReader(InputStream inStream) {
        return getBufferReader(inStream,"UTF-8");
    }
    
    /**
     * 将字节输入流转换为缓冲字符输入流
     * @param inStream 字节流
     * @param charset 转换字符集
     * @return 缓冲字符流
     */
    public static BufferedReader getBufferReader(InputStream inStream,String charset) {
        try {
            return new BufferedReader(new InputStreamReader(inStream,charset));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }
    
    /**
     * 将字节数组反序列化为对象
     * @param b 字节数组
     * @param returnTypes 返回类型
     * @return 泛化类型
     */
    public static <R> R deserialize(byte[] b,Class<R>... returnTypes) {
        ByteArrayInputStream bais=new ByteArrayInputStream(b);
        try{
            R r=deserialize(bais,returnTypes);
            return r;
        }finally{
            try {
                if(null!=bais) bais.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    
    /**
     * 从指定输入流反序列化对象
     * @param is 字节输入流
     * @param returnTypes 返回类型
     * @return 泛化类型
     */
    public static <R> R deserialize(InputStream is,Class<R>... returnTypes) {
        Class<?> returnType=isEmpty(returnTypes)?Object.class:returnTypes[0];
        ObjectInputStream ois=null;
        try {
            ois=new ObjectInputStream(is);
            R r= (R)returnType.cast(ois.readObject());
            return r;
        } catch (Exception e) {
            e.printStackTrace();
        } finally{
            try{
                if(null!=ois) ois.close();
            } catch(IOException e){
                e.printStackTrace();
            }
        }
        return null;
    }
    
    /**
     * 对象序列化
     * @param object 对象
     * @return 序列化字节数组
     */
    public static byte[] serializeByBytes(Object object) {
        ByteArrayOutputStream baos=null;
        try{
            baos=serializeByStream(object);
            byte[] b=baos.toByteArray();
            return b;
        } finally{
            try{
                if(null!=baos) baos.close();
            } catch(IOException e){
                e.printStackTrace();
            }
        }
    }
    
    /**
     * 对象序列化
     * @param object 对象
     * @return 字节数组输出流
     */
    public static ByteArrayOutputStream serializeByStream(Object object) {
        ByteArrayOutputStream baos=new ByteArrayOutputStream();
        serialize(object,baos);
        return baos;
    }
    
    /**
     * 对象序列化
     * @param object 对象
     * @param os 字节输出流
     */
    public static void serialize(Object object,OutputStream os) {
        if(isEmpty(object)) return;
        ObjectOutputStream oos=null;
        try {
            oos=new ObjectOutputStream(os);
            oos.writeObject(object);
        } catch (IOException e) {
            e.printStackTrace();
        } finally{
            try{
                if(null!=oos) oos.close();
            } catch(IOException e){
                e.printStackTrace();
            }
        }
    }
    
    /**
     * 随机一个UUID串
     * @return UUID串
     */
    public static String randomUUID(int... section){
        if(isEmpty(section)) return UUID.randomUUID().toString().replace("-", "");
        return DASH_HUMP.split(UUID.randomUUID().toString())[section[0]];
    }
    
    /**
     * 使用当前时间毫秒数和可选前缀随机一个ID串
     * @return ID串
     */
    public static String getIDByCurrentTime(String... prefix){
        if(isEmpty(prefix)) return ""+System.currentTimeMillis();
        return new StringBuilder(prefix[0].trim()).append(System.currentTimeMillis()).toString();
    }
    
    /**
     * 使用可选前缀随机一个整数串
     * @param range 随机数的范围
     * @param prefix 随机数的前缀
     * @return 返回1~range之间的整数
     * @description 返回的整数位与参数range的位数相同,位数不足则在前面补0
     */
    public static String randomInt(int range,String... prefix){
        int numSize=(range+"").length();
        Random random=new Random();
        String ranNum=random.nextInt(range)+"";
        
        int loopTimes=numSize-ranNum.length();
        StringBuilder builder=new StringBuilder("");
        for(int i=0;i<loopTimes;builder.append("0"),i++);
        builder.append(ranNum);
        
        if(isEmpty(prefix)) return builder.toString();
        return prefix[0].trim()+builder.toString();
    }
    
    /**
     * 将字符串首字母转换成小写
     * @param src 字符串
     * @return 小写首字母的字符串
     */
    public static String lowerFirstChar(String src){
        if(null==src || src.trim().isEmpty()) return src;
        String string=src.trim();
        char firstChar=string.charAt(0);
        return Character.toLowerCase(firstChar)+string.substring(1);
    }
    
    /**
     * 将字符串首字母转换成大写
     * @param src 字符串
     * @return 小写首字母的字符串
     */
    public static String upperFirstChar(String src){
        if(null==src || src.trim().isEmpty()) return src;
        String string=src.trim();
        char firstChar=string.charAt(0);
        return Character.toUpperCase(firstChar)+string.substring(1);
    }
    
    /**
     * 获取指定类型的简单对象名
     * @param type 类型
     * @return 简单对象名
     */
    public static String getBeanName(Class<?> type){
        return lowerFirstChar(type.getSimpleName());
    }
    
    /**
     * 获取全类名对应的简单对象名
     * @param className 全类名
     * @return 简单对象名
     */
    public static String getBeanName(String className){
        int lastIndex=className.lastIndexOf(".");
        String simpleClassName=className.substring(lastIndex+1);
        return lowerFirstChar(simpleClassName);
    }
    
    /**
     * 根据字段获取get方法名
     * @param field 字段
     * @return get方法名
     */
    public static String getGetMethodNameFromFieldName(Field field){
        return getGetMethodNameFromFieldName(field.getName());
    }
    
    /**
     * 根据字段名称获取get方法名
     * @param fieldName 字段名称
     * @return get方法名
     */
    public static String getGetMethodNameFromFieldName(String fieldName){
        return "get"+upperFirstChar(fieldName);
    }
    
    /**
     * 根据字段获取set方法名
     * @param field 字段
     * @return set方法名
     */
    public static String getSetMethodNameFromFieldName(Field field){
        return getSetMethodNameFromFieldName(field.getName());
    }
    
    /**
     * 根据字段名称获取set方法名
     * @param fieldName 字段名称
     * @return set方法名
     */
    public static String getSetMethodNameFromFieldName(String fieldName){
        return "set"+upperFirstChar(fieldName);
    }
    
    /**
     * 从JavaBean的get/set方法中提取字段名称
     * @param method get/set方法
     * @return 字段名称
     */
    public static String getFieldNameFromGetSetMethod(Method getsetMethod){
        return getFieldNameFromGetSetMethod(getsetMethod.getName());
    }
    
    /**
     * 从JavaBean的get/set方法名中提取字段名称
     * @param getsetMethodName get/set方法名
     * @return 字段名称
     */
    public static String getFieldNameFromGetSetMethod(String getsetMethodName){
        String tmpAttrName=getsetMethodName.substring(3);
        return lowerFirstChar(tmpAttrName);
    }
    
    /**
     * 获取指定类的直接超类的泛型参数类型表
     * @param subClass 子类
     * @param defaultClass 默认泛型参数类型
     * @return 泛型参数类型表
     */
    public static Class<?>[] getSuperClassGenericArgument(Class<?> subClass,Class<?>... defaultClass) {
        Class<?>[] defaultClassArray=null==defaultClass||0==defaultClass.length?null:defaultClass;
        if(null==subClass || Object.class==subClass) return defaultClassArray;
        Type genericSuperclass = subClass.getGenericSuperclass();
        if (!ParameterizedType.class.isInstance(genericSuperclass)) return defaultClassArray;
        Type[] actualTypeArguments = ((ParameterizedType) genericSuperclass).getActualTypeArguments();
        if(null==actualTypeArguments||0==actualTypeArguments.length) return defaultClassArray;
        Class<?>[] classArray=new Class<?>[actualTypeArguments.length];
        System.arraycopy(actualTypeArguments, 0, classArray, 0, classArray.length);
        return classArray;
    }
    
    /**
     * 判断对象是否为空
     * @param object 对象
     * @return 是否为空
     */
    public static boolean isEmpty(Object object){
        return 0==getLength(object,true);
    }
    
    /**
     * 判断对象是否为非空
     * @param object 对象
     * @return 是否为非空
     */
    public static boolean isNotEmpty(Object object){
        return 0!=getLength(object,true);
    }
    
    /**
     * 判断对象数组中的每个对象是否都为空
     * @param objects 对象数组
     * @return 是否所有对象都为空
     */
    public static boolean isAllEmpty(Object... objects){
        for(Object object:objects) if(0!=getLength(object,true)) return false;
        return true;
    }
    
    /**
     * 判断对象数组中的每个对象是否都为非空
     * @param objects 对象数组
     * @return 是否所有对象都为非空
     */
    public static boolean isAllNotEmpty(Object... objects){
        for(Object object:objects) if(0==getLength(object,true)) return false;
        return true;
    }
    
    /**
     * 判断数字类型值是否为空或0
     * @param number
     * @return
     */
    public static boolean isEmpty(Number number){
        return (null==number || "0".equals(number.toString())) ? true : false;
    }
    
    /**
     * 获取序列、字典或实体的长度
     * @param object 序列或字典
     * @param nullIsZeros NULL是否等效于0长度
     * @return 序列或字典的长度
     * @description 序列的长度是序列中元素的数量,字典的长度是字典中映射的数量,实体的长度是实体中字段的数量
     */
    public static Integer getLength(Object object,Boolean... nullIsZeros){
        boolean nullIsZero=null==nullIsZeros||0==nullIsZeros.length?false:nullIsZeros[0];
        if(null==object) return nullIsZero?0:null;
        if(Map.class.isInstance(object)){
            return ((Map)object).size();
        } else if(object.getClass().isArray()){
            return Array.getLength(object);
        } else if(String.class.isInstance(object)){
            return object.toString().trim().length();
        } else if(CharSequence.class.isInstance(object)){
            return ((CharSequence)object).length();
        } else if(Iterable.class.isInstance(object)){
            int counter=0;
            Iterator its=((Iterable)object).iterator();
            for(;its.hasNext();counter++,its.next());
            return counter;
        } else{
            return object.getClass().getDeclaredFields().length;
        }
    }
    
    /**
     * 将对象中的字段值包装为一个对象数组
     * @param bean 对象
     * @return 对象数组
     */
    public static Object[] toArray(Object bean){
        List<Object> list=toList(bean);
        if(null==list) return null;
        return list.toArray(new Object[list.size()]);
    }
    
    /**
     * 将对象中的字段值包装为一个对象列表
     * @param bean 对象
     * @return 对象列表
     */
    public static ArrayList<Object> toList(Object bean){
        if(null==bean) return null;
        Class<?> type=bean.getClass();
        Field[] fields=type.getDeclaredFields();
        ArrayList<Object> list=new ArrayList<Object>();
        for(Field field:fields){
            field.setAccessible(true);
            try {
                list.add(field.get(bean));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return list;
    }
    
    /**
     * 将对象中的字段名与字段值包装成一个字典对象
     * @param bean 对象
     * @return 字典对象
     */
    public static LinkedHashMap<String,Object> toMap(Object bean){
        if(null==bean) return null;
        Class<?> type=bean.getClass();
        Field[] fields=type.getDeclaredFields();
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        for(Field field:fields){
            field.setAccessible(true);
            try {
                map.put(field.getName(), field.get(bean));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return map;
    }
    
    /**
     * 字串类型JSON转换为Java对象列表
     * @param srcJson 字串JSON源
     * @param elementType List集合元素类型
     * @return 泛化列表
     */
    public static <E> LinkedHashSet<E> jsonStrToSet(String srcJson,Class<E> elementType) {
        return new LinkedHashSet<E>(jsonStrToList(srcJson,elementType));
    }
    
    /**
     * 字串类型JSON转换为Java对象列表
     * @param srcJson 字串JSON源
     * @param elementType List集合元素类型
     * @return 泛化列表
     */
    public static <E> ArrayList<E> jsonStrToList(String srcJson,Class<E> elementType) {
        ArrayList<?> list=jsonStrToJava(srcJson,ArrayList.class);
        if(null==list || list.isEmpty()) return null;
        if(Object.class==elementType) return (ArrayList)list;
        
        ArrayList<E> returnList=new ArrayList<E>();
        try {
            if(isSimpleType(elementType)){
                for(Object object:list) returnList.add(transferType(object, elementType));
                return returnList;
            }
            
            if(Map.class.isAssignableFrom(elementType)){
                for(Object object:list)returnList.add((E)object);
                return returnList;
            }
            
            for(Object object:list){
                E e=elementType.newInstance();
                Set<Entry<String, Object>> entrys=((Map<String,Object>)object).entrySet();
                for(Entry<String, Object> entry:entrys){
                    Field field=findField(elementType,entry.getKey());
                    if(null==field) continue;
                    field.set(e, transferType(entry.getValue(),field.getType()));
                }
                returnList.add(e);
            }
            return returnList;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    /**
     * 字串类型JSON转换为Java对象
     * @param srcJson 字串JSON源
     * @param returnType 返回类型
     * @return 泛化类型
     */
    public static <R> R jsonStrToJava(String srcJson,Class<R> returnType) {
        if(null==srcJson) return null;
        
        Object mapper=getObjectMapper();
        if(null==mapper) return null;
        
        Method targetMethod=getObjectMapperMethod("readValue");
        if(null==targetMethod) return null;
        
        try {
            return (R)targetMethod.invoke(mapper, srcJson,returnType);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        return null;
    }
    
    /**
     * Java对象转换为字串类型JSON
     * @param object java对象
     * @return 字串类型
     */
    public static String javaToJsonStr(Object object) {
        if(null==object) return null;
        
        Object mapper=getObjectMapper();
        if(null==mapper) return null;
        
        Method targetMethod=getObjectMapperMethod("writeValueAsString");
        if(null==targetMethod) return null;
        
        try {
            return (String)targetMethod.invoke(mapper, object);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        return null;
    }
    
    /**
     * 获取ObjectMapper类中的方法
     * @param methodName 方法名
     * @return 方法对象
     */
    public static Method getObjectMapperMethod(String methodName) {
        if(null==methodName || (methodName=methodName.trim()).isEmpty()) return null;
        Method method=ApplicationUtil.getBean(methodName,Method.class);
        if(null!=method) return method;
        
        Object mapper=getObjectMapper();
        if(null==mapper) return null;
        
        Method targetMethod=null;
        if("readValue".equals(methodName)) {
            targetMethod=findMethod(mapper.getClass(),"readValue",String.class,Class.class);
        }else if("writeValueAsString".equals(methodName)) {
            targetMethod=findMethod(mapper.getClass(),"writeValueAsString",Object.class);
        }
        
        if(null!=targetMethod) ApplicationUtil.registerSingleton(methodName, targetMethod);
        return targetMethod;
    }
    
    /**
     * 将JavaBean类型转换为字典Map类型(静态方法)
     * @description 按公有get方法转化
     * @param bean Bean类型
     * @return 字典对象
     */
    public static LinkedHashMap<String,Object> beanToMap(Class beanType){
        if(null==beanType) return null;
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        HashMap<String, Method> getMethodDict=findGetMethods(beanType);
        for(Map.Entry<String, Method> entry:getMethodDict.entrySet()) {
            Object fieldValue=null;
            try {
                fieldValue=entry.getValue().invoke(beanType);
                if(null==fieldValue) continue;
            } catch (Exception e) {
                e.printStackTrace();
            }
            map.put(getFieldNameFromGetSetMethod(entry.getKey()), fieldValue);
        }
        return map;
    }
    
    /**
     * 将JavaBean类型转换为字典Map类型
     * @description 按公有get方法转化
     * @param bean Bean对象
     * @return 字典对象
     */
    public static LinkedHashMap<String,Object> beanToMap(Object bean){
        if(null==bean) return null;
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        HashMap<String, Method> getMethodDict=findGetMethods(bean.getClass());
        for(Map.Entry<String, Method> entry:getMethodDict.entrySet()) {
            Object fieldValue=null;
            try {
                fieldValue=entry.getValue().invoke(bean);
                if(null==fieldValue) continue;
            } catch (Exception e) {
                e.printStackTrace();
            }
            map.put(getFieldNameFromGetSetMethod(entry.getKey()), fieldValue);
        }
        return map;
    }
    
    /**
     * 将Entity类型转换为字典Map类型(静态字段)
     * @description 按所有声明字段转化
     * @param entity 实体类型
     * @return 字典对象
     */
    public static LinkedHashMap<String,Object> entityToMap(Class entityType){
        HashMap<String,Field> fields=findFields(entityType);
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        for(Map.Entry<String,Field> fieldEntry:fields.entrySet()){
            try {
                map.put(fieldEntry.getKey(), fieldEntry.getValue().get(entityType));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return map;
    }
    
    /**
     * 将Entity类型转换为字典Map类型
     * @description 按所有声明字段转化
     * @param entity 实体对象
     * @return 字典对象
     */
    public static LinkedHashMap<String,Object> entityToMap(Object entity){
        HashMap<String,Field> fields=findFields(entity.getClass());
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        for(Map.Entry<String,Field> fieldEntry:fields.entrySet()){
            try {
                map.put(fieldEntry.getKey(), fieldEntry.getValue().get(entity));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return map;
    }
    
    /**
     * 将字典Map类型转换为JavaBean类型
     * @description 按公有set方法转化
     * @param map 字典对象
     * @param type Bean类型
     * @return Bean对象
     */
    public static <R> R mapToBean(Map map,Class<R> type){
        R r=null;
        try {
            r = type.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        
        HashMap<String, Set<Method>> setMethodMap=findSetMethods(type);
        Set<Map.Entry> entrys=map.entrySet();
        for(Map.Entry entry:entrys){
            String setMethodName=getSetMethodNameFromFieldName((String)entry.getKey());
            Set<Method> methodSet=setMethodMap.get(setMethodName);
            if(null==methodSet||0==methodSet.size()) continue;
            
            Method targetMethod=null;
            Object value=entry.getValue();
            for(Method method:methodSet){
                if(!compatible(method.getParameterTypes()[0], value.getClass())) continue;
                targetMethod=method;
                break;
            }
            if(null==targetMethod) continue;
            
            try {
                targetMethod.invoke(r, value);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        
        return r;
    }
    
    /**
     * 将字典Map类型转换为Entity类型
     * @description 按所有声明字段转化
     * @param map 字典对象
     * @param type 实体类型
     * @return 实体对象
     */
    public static <R> R mapToEntity(Map map,Class<R> type){
        R r=null;
        try {
            r = type.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        
        HashMap<String, Field> fieldDict=findFields(type);
        Set<Map.Entry> entrys=map.entrySet();
        for(Map.Entry entry:entrys){
            Field field=fieldDict.get(entry.getKey());
            if(null==field) continue;
            try {
                field.set(r, transferType(entry.getValue(),field.getType()));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return r;
    }
    
    /**
     * 将可迭代类型转换为字典类型
     * @param iterable 可迭代对象
     * @return 字典类型
     */
    public static LinkedHashMap<Object,Object> iterableToMap(Iterable<Map.Entry> iterable){
        LinkedHashMap<Object,Object> map=new LinkedHashMap<Object,Object>();
        for(Map.Entry entry:iterable){
            map.put(entry.getKey(), entry.getValue());
        }
        return map;
    }
    
    /**
     * 将字典类型转换为集合类型
     * @param map 字典对象
     * @param collectionType 集合类
     * @return 集合类型
     */
    public static <R extends Collection> R MapToCollection(Map map,Class<R> collectionType){
        if(Set.class.isAssignableFrom(collectionType)){
            return (R)new LinkedHashSet(map.entrySet());
        }
        ArrayList list=new ArrayList();
        for(Object object:map.entrySet()) list.add(object);
        return (R)list;
    }
    
    /**
     * 将数组类型转换为列表类型
     * @param array 数组类型
     * @return 列表类型
     */
    public static ArrayList arrayToList(Object array){
        if(null==array) return null;
        Class<?> type=array.getClass();
        if(!type.isArray()) return new ArrayList(Arrays.asList(array));
        ArrayList list=new ArrayList();
        int arrLen=Array.getLength(array);
        for(int i=0;i<arrLen;list.add(Array.get(array, i)),i++);
        return list;
    }
    
    /**
     * 将数组类型转换为字典类型
     * @param array 数组类型
     * @return 字典类型
     */
    public static LinkedHashMap<String,Object> arrayToMap(Map.Entry[] array){
        if(null==array) return null;
        LinkedHashMap<String,Object> map=new LinkedHashMap<String,Object>();
        for(Map.Entry entry:array){
            Object key=entry.getKey();
            map.put(null==key?null:key.toString(), entry.getValue());
        }
        return map;
    }
    
    /**
     * 将字典类型转换为数组类型
     * @param map 字典类型
     * @return 数组类型
     */
    public static Map.Entry[] mapToArray(Map map){
        Set<Map.Entry> set=map.entrySet();
        return set.toArray(new Map.Entry[map.size()]);
    }
    
    /**
     * 将可迭代类型转换为Entity类型
     * @description 按所有声明字段转化
     * @param iterable 可迭代对象
     * @param type 实体类型
     * @return 实体对象
     */
    public static <R> R iterableToEntity(Iterable iterable,Class<R> type){
        LinkedHashMap<Object,Object> map=iterableToMap(iterable);
         return mapToEntity(map,type);
    }
    
    /**
     * 将Entity类型转换为集合类型
     * @description 按所有声明字段转化
     * @param entity 实体对象
     * @param collectionType 集合类型
     * @return 集合类型
     */
    public static <R> R entityToCollection(Object entity,Class<R> collectionType){
        LinkedHashMap<String,Object> map=entityToMap(entity);
        if(Set.class.isAssignableFrom(collectionType)){
            return (R)new LinkedHashSet(map.entrySet());
        }
        ArrayList list=new ArrayList();
        for(Object object:map.entrySet()) list.add(object);
        return (R)list;
    }
    
    /**
     * 将第一个Entity参数对象的值转化到第二个参数目标类型对象中
     * @param srcEntity 源对象类型
     * @param dstType 目标实体类型
     * @return 泛化类型
     */
    public static <R> R entityToEntity(Object srcEntity,Class<R> dstType){
        R r=null;
        try {
            r = dstType.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        mergeTo(srcEntity,r);
        return r;
    }
    
    /**
     * 将第一个Entity参数对象的值合并到第二个参数Entity对象中
     * @param srcEntity 源对象
     * @param dstEntity 目标对象
     */
    public static void mergeTo(Object srcEntity,Object dstEntity){
        if(null==srcEntity || null==dstEntity) return;
        if(Class.class.isInstance(srcEntity) || Class.class.isInstance(dstEntity)) return;
        
        HashMap<String,Field> srcFieldDict=findFields(srcEntity.getClass());
        HashMap<String,Field> dstFieldDict=findFields(dstEntity.getClass());
        if(null==srcFieldDict || null==dstFieldDict || 0==srcFieldDict.size() || 0==dstFieldDict.size()) return;
        
        for(Map.Entry<String, Field> srcFieldEntry:srcFieldDict.entrySet()) {
            Field dstField=dstFieldDict.get(srcFieldEntry.getKey());
            if(null==dstField) continue;
            try {
                dstField.set(dstEntity, transferType(srcFieldEntry.getValue(),dstField.getType()));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    
    /**
     * 获取SpringBoot的JSON工具
     * @return ObjectMapper对象
     */
    public static Object getObjectMapper() {
        Object object=ApplicationUtil.getBean("objectMapper",Object.class);
        if(null!=object) return object;
        Class<?> mapperType=null;
        try {
            mapperType = Class.forName(JSON_UTIL_CLASS);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        if(null==mapperType) return null;
        return getObjectMapper(mapperType);
    }
    
    /**
     * 获取SpringBoot的JSON工具
     * @param type ObjectMapper类型
     * @return ObjectMapper对象
     */
    public static <R> R getObjectMapper(Class<R> type) {
        if(!JSON_UTIL_CLASS.equals(type.getName())) return null;
        R r=ApplicationUtil.getRandomBean(type);
        if(null!=r) return r;
        try {
            ApplicationUtil.registerSingleton("objectMapper", r=type.newInstance());
            return r;
        } catch (Exception e) {
            return null;
        }
    }
    
    /**
     * 短横线命名法转驼峰命名法
     * @param name 短横线参数名或字段名
     * @return 实体类属性名
     */
    public static String dashToHump(String name){
        String[] parts=DASH_HUMP.split(name);
        if(1 == parts.length)return parts[0];
        StringBuilder builder=new StringBuilder(parts[0]);
        for(int i=1;i<parts.length;i++){
            String part=parts[i];
            builder.append(Character.toUpperCase(part.charAt(0))).append(part.substring(1));
        }
        return builder.toString();
    }
    
     /**
     * JAVA类型之间的相互转换
     * @param object 被转换的源对象
     * @param returnType 返回类型
     * @param keyType 集合下标类型
     * @param elementTypes 集合元素类型
     * @return 泛化类型
     */
    public static <R,E> R objectToType(Object object,Class<R> returnType,Class<?> keyType,Class<E>... elementTypes) throws Exception{
        if(null==object) return null;
        if(null==returnType || Object.class==returnType) return (R)object;
        
        Class<?> srcType=object.getClass();
        if(returnType.isAssignableFrom(srcType)) return (R)object;
        
        String stringValue=toString(object);
        if(null==stringValue) return null;
        
        if(null==keyType) keyType=Object.class;
        Class<?> elementType=null==elementTypes||0==elementTypes.length?Object.class:elementTypes[0];
        if(String.class.isAssignableFrom(returnType)){
            return (R)stringValue;
        }else if(isNumber(returnType)){
            String parseValue=null;
            if(String.class.isAssignableFrom(srcType) || isNumber(srcType)) {
                parseValue=stringValue;
            }else if(Date.class.isAssignableFrom(srcType)){
                parseValue=((Date)object).getTime()+"";
            }else if(Calendar.class.isAssignableFrom(srcType)){
                parseValue=((Calendar)object).getTimeInMillis()+"";
            }else{
                throw new RuntimeException("array, collection, and compound types are not supported to convert numeric types!!!");
            }
            return stringToNumber(parseValue,returnType);
        }else if(Date.class.isAssignableFrom(returnType)){
            if(String.class.isAssignableFrom(srcType) || Date.class.isAssignableFrom(srcType)) {
                return (R)DateUtil.stringToDate(stringValue, (Class<Date>)returnType);
            }else if(isNumber(srcType)){
                return (R)returnType.getConstructor(long.class).newInstance(((Number)object).longValue());
            }else if(Calendar.class.isAssignableFrom(srcType)){
                return (R)returnType.getConstructor(long.class).newInstance(((Calendar)object).getTimeInMillis());
            }else{
                throw new RuntimeException("array, collection, and compound types are not supported to convert date types!!!");
            }
        }else if(Calendar.class.isAssignableFrom(returnType)){
            if(String.class.isAssignableFrom(srcType) || Calendar.class.isAssignableFrom(srcType)) {
                return (R)DateUtil.stringToCalendar(stringValue);
            }else if(isNumber(srcType)){
                java.util.Calendar calendar=java.util.Calendar.getInstance();
                calendar.setTimeInMillis(((Number)object).longValue());
                return (R)calendar;
            }else if(Date.class.isAssignableFrom(srcType)){
                java.util.Calendar calendar=java.util.Calendar.getInstance();
                calendar.setTimeInMillis(((Date)object).getTime());
                return (R)calendar;
            }else{
                throw new RuntimeException("array, collection, and compound types are not supported to convert calendar types!!!");
            }
        }else if(Boolean.class==returnType || boolean.class==returnType){
            return (R)Boolean.valueOf(stringValue);
        }else if(Character.class==returnType || char.class==returnType){
            return (R)Character.valueOf(stringValue.charAt(0));
        }else if(returnType.isArray()){
            Object[] array= jsonStrToJava(stringValue,Object[].class);
            Class<?> compType=returnType.getComponentType();
            Object retArr=Array.newInstance(compType, array.length);
            for(int i=0;i<array.length;Array.set(retArr, i, objectToType(array[i],compType,null)),i++);
            return (R)retArr;
        }else if(Iterable.class.isAssignableFrom(returnType)){
            Method addMethod=null;
            try{
                addMethod=returnType.getMethod("add", Object.class);
            }catch(Exception e) {
                throw new RuntimeException("Element  Must Be Type: java.util.Collection",e);
            }
            
            Object r=null;
            if(!returnType.isInterface()) {
                r=returnType.newInstance();
            }else{
                if(List.class.isAssignableFrom(returnType)) {
                    r=new ArrayList<E>();
                }else if(Set.class.isAssignableFrom(returnType)) {
                    r=new HashSet<E>();
                }else if(Queue.class.isAssignableFrom(returnType)) {
                    r=new LinkedBlockingQueue<E>();
                }else{
                    throw new RuntimeException("Not Support Element Type: "+elementType.getName());
                }
            }
            
            Object[] array= jsonStrToJava(stringValue,Object[].class);
            for(int i=0;i<array.length;addMethod.invoke(r, objectToType(array[i++],elementType,null)));
            return (R)r;
        }else if(Map.class.isAssignableFrom(returnType)){
            Method putMethod=null;
            try{
                putMethod=returnType.getMethod("put", Object.class,Object.class);
            }catch(Exception e) {
                throw new RuntimeException("Element  Must Be Type: java.util.Map",e);
            }
            
            Object r=null;
            if(!returnType.isInterface()) {
                r=returnType.newInstance();
            }else{
                r=new HashMap<Object,E>();
            }
            
            Map<Object,Object> map= jsonStrToJava(stringValue,Map.class);
            for(Map.Entry<Object, Object> entry:map.entrySet()){
                putMethod.invoke(r, objectToType(entry.getKey(),keyType,null),objectToType(entry.getValue(),elementType,null));
            }
            return (R)r;
        }else{
            Map<Object,Object> map= jsonStrToJava(stringValue,Map.class);
            HashMap<String, Field> fieldDict=findFields(returnType);
            R r=returnType.newInstance();
            for(Map.Entry<Object, Object> entry:map.entrySet()){
                Object key=entry.getKey();
                Object value=entry.getValue();
                if(null==key || null==value) continue;
                String fieldName=key.toString().trim();
                if(fieldName.isEmpty()) continue;
                Field field=fieldDict.get(fieldName);
                if(null==field) continue;
                field.set(r, objectToType(value,field.getType(),null));
            }
            return (R)r;
        }
    }
    
    /**
     * 从JSON表达中获取参数键映射的值
     * @param src JSON表达源(字串、字典或实体)
     * @param key 键
     * @param defaultValues 默认值
     * @return 泛化类型
     */
    public static Object getValue(Object src,Object key,Object... defaultValues){
        return getValue(src,key,Object.class,defaultValues);
    }
    
    /**
     * 从JSON表达中获取参数键映射的值
     * @param src JSON表达源
     * @param key 键
     * @param valueType 返回类型
     * @param defaultValues 默认值
     * @return 泛化类型
     */
    public static <R> R getValue(Object src,Object key,Class<R> valueType,R... defaultValues){
        return getValue(src,key,null,valueType,defaultValues);
    }
    
    /**
     * 从JSON表达中获取参数键映射的值
     * @param src JSON表达源
     * @param key 键
     * @param defaultKey 默认键
     * @param valueType 返回类型
     * @param defaultValues 默认值
     * @return 泛化类型
     */
    public static <R> R getValue(Object src,Object key,Object defaultKey,Class<R> valueType,R... defaultValues){
        if(null==src||null==key) return null;
        R defaultValue=null==defaultValues||0==defaultValues.length?null:defaultValues[0];
        
        Object result=null;
        Map<String, Object> dict=null;
        try {
            dict = transferType(src,Map.class);
        } catch (Exception e1) {
            e1.printStackTrace();
            return null;
        }
        
        if(null==(result=dict.get(key))&&null!=defaultKey) result=dict.get(defaultKey);
        if(null==result && null!=defaultValue) return defaultValue;
        if(null==result) return null;
        
        try {
            return transferType(result,valueType);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    
    /**
     * 获取EL表达式的值
     * @param src EL对象源
     * @param elExpression EL表达式
     * @param defaultValues 默认值
     * @return 对象值
     */
    public static Object getELValue(Object src,String elExpression,Object... defaultValues){
        return getELValue(src,elExpression,Object.class,defaultValues);
    }
    
    /**
     * 获取EL表达式的值
     * @param src EL对象源
     * @param elExpression EL表达式
     * @param returnType 返回类型
     * @param defaultValues 默认值
     * @return 对象值
     */
    public static <R> R getELValue(Object src,String elExpression,Class<R> returnType,R... defaultValues){
        R defaultValue=null==defaultValues||0==defaultValues.length?null:defaultValues[0];
        if(null==src) return defaultValue;
        if(!elExpression.startsWith("${")||!elExpression.endsWith("}"))  throw new RuntimeException("error! not be EL expression...");
        String el=elExpression.substring(2, elExpression.length()-1);
        Object result=getOgnlValue(src,el);
        if(null==result) return defaultValue;
        try {
            return transferType(result,returnType);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    
    /**
     * 获取OGNL对象图中的属性值
     * @description 获取对象导航图中的值,暂不支持集合投影
     * @param src ognl源对象(字串、字典或实体)
     * @param ognlExpression ognl表达式 
     * @return 对象值
     */
    public static Object getOgnlValue(Object src,String ognlExpression){
        if(null==src||null==ognlExpression||ognlExpression.trim().isEmpty()) return null;
        String ognl=ognlExpression.trim();
        int dotIndex=ognl.indexOf(".");
        int squareIndex=ognl.indexOf("[");
        
        int endIndex=-1;
        if(-1!=dotIndex && -1!=squareIndex){
            endIndex=dotIndex<squareIndex?dotIndex:squareIndex;
        }else if(-1!=dotIndex) {
            endIndex=dotIndex;
        }else{
            endIndex=squareIndex;
        }
        
        String nextKey=null;
        String currentKey=null;
        if(-1==endIndex){
            currentKey=ognl;
        }else if(0!=endIndex){
            currentKey=ognl.substring(0, endIndex).trim();
            nextKey=ognl.substring(endIndex+1).trim();
        }else{
            return getOgnlValue(src,ognlExpression.substring(1));
        }
        
        int arrayIndex=-1;
        String fieldName=null;
        if(!currentKey.endsWith("]")){
            fieldName=currentKey;
        }else{
            String temp=currentKey.substring(0, currentKey.length()-1).trim();
            if(QUOTATIONS.contains(temp.charAt(0))&&QUOTATIONS.contains(temp.charAt(temp.length()-1))){
                fieldName=temp.substring(1, temp.length()-1).trim();
            }else{
                if(QUOTATIONS.contains(temp.charAt(0))) temp=temp.substring(1, temp.length()).trim();
                if(QUOTATIONS.contains(temp.charAt(temp.length()-1))) temp=temp.substring(0, temp.length()-1).trim();
                if(isNumber(temp)){
                    arrayIndex=Integer.parseInt(temp);
                }else{
                    fieldName=temp;
                }
            }
        }
        
        Object nextSrc=null;
        if(-1==arrayIndex && null!=fieldName){
            Matcher matcher=METHOD_SIGNATURE.matcher(fieldName);
            if(!matcher.find()){
                nextSrc=getValue(src,fieldName);
            }else{
                String methodName=matcher.group(1);
                String methodParams=matcher.group(2);
                if(null==methodParams||methodParams.trim().isEmpty()){
                    Method method=findMethod(src,methodName);
                    try {
                        nextSrc=method.invoke(src);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return null;
                    }
                }else{
                    String[] args=COMMA.split(methodParams);
                    Object[] params=new Object[args.length];
                    for(int i=0;i<args.length;i++){
                        String tmpArgs=args[i].trim();
                        if(isNumber(tmpArgs)){
                            if(-1==tmpArgs.indexOf(".")){
                                params[i]=Integer.parseInt(tmpArgs);
                            }else{
                                params[i]=Double.parseDouble(tmpArgs);
                            }
                        }else if(tmpArgs.equals("true")){
                            params[i]=true;
                        }else if(tmpArgs.equals("false")){
                            params[i]=false;
                        }else{
                            if(QUOTATIONS.contains(tmpArgs.charAt(0))) tmpArgs=tmpArgs.substring(1);
                            if(QUOTATIONS.contains(tmpArgs.charAt(tmpArgs.length()-1))) tmpArgs=tmpArgs.substring(0,tmpArgs.length()-1);
                            params[i]=tmpArgs;
                        }
                    }
                    Method method=findMethod(src,methodName,params);
                    try {
                        nextSrc=method.invoke(src,params);
                    } catch (Exception e) {
                        e.printStackTrace();
                        return null;
                    }
                }
            }
        }else if(null==fieldName && -1!=arrayIndex){
            nextSrc=getValue(src,arrayIndex);
        }else{
            return null;
        }
        
        if(null==nextSrc||null==nextKey||nextKey.trim().isEmpty()) return nextSrc;
        return getOgnlValue(nextSrc,nextKey);
    }
    
    /**
     * 使用srcObject更新dstObject
     * @param srcObject 被更新的原始对象
     * @param newObject 用于更新的新对象
     * @description 将srcObject中的非null字段值更新到dstObject中对应字段上
     * @return dstObject
     */
    public static final Map merge(Map dstObject,Map srcObject){
        HashMap copyMap=new HashMap(dstObject);
        Set<Entry> dstEntrys=dstObject.entrySet();
        for(Map.Entry dstEntry:dstEntrys){
            Object dstKey=dstEntry.getKey();
            if(!srcObject.containsKey(dstKey)) continue;
            Object srcValue=srcObject.get(dstKey);
            if(null==srcValue) continue;
            if(!dstEntry.getValue().getClass().isInstance(srcValue)) continue;
            copyMap.put(dstKey, srcValue);
        }
        dstObject.putAll(copyMap);
        return dstObject;
    }
    
    /**
     * 使用srcObject更新dstObject
     * @param srcObject 被更新的原始对象
     * @param newObject 用于更新的新对象
     * @description 将srcObject中的非null字段值更新到dstObject中对应字段上
     * @return dstObject
     */
    public static final <R> R merge(R dstObject,Map<String,Object> srcObject){
        Class<?> dstType=dstObject.getClass();
        Field[] dstFields=dstType.getDeclaredFields();
        try{
            for(Field dstField:dstFields){
                dstField.setAccessible(true);
                String dstFieldName=dstField.getName();
                if(!srcObject.containsKey(dstFieldName)) continue;
                Object srcValue=srcObject.get(dstFieldName);
                if(null==srcValue) continue;
                if(!dstField.getType().isInstance(srcValue)) continue;
                dstField.set(dstObject, srcValue);
            }
        }catch(Exception e){
            e.printStackTrace();
        }
        return dstObject;
    }
    
    /**
     * 使用srcObject更新dstObject
     * @param srcObject 被更新的原始对象
     * @param newObject 用于更新的新对象
     * @description 将srcObject中的非null字段值更新到dstObject中对应字段上
     * @return dstObject
     */
    public static final <R> R merge(R dstObject,R srcObject){
        Class<?> dstType=dstObject.getClass();
        Class<?> srcType=srcObject.getClass();
        Field[] dstFields=dstType.getDeclaredFields();
        try{
            for(Field dstField:dstFields){
                dstField.setAccessible(true);
                String dstFieldName=dstField.getName();
                Field srcField=findField(srcType,dstFieldName);
                if(null==srcField || !dstField.getType().isAssignableFrom(srcField.getType())) continue;
                
                Object srcValue=null;
                if(null==(srcValue=srcField.get(srcObject))) continue;
                dstField.set(dstObject, srcValue);
            }
        }catch(Exception e){
            e.printStackTrace();
        }
        return dstObject;
    }
    
    /**
     * 查找对象中的方法
     * @param target 对象
     * @param method 方法名
     * @param args 参数列表
     * @return 方法对象
     */
    public static final Method findMethod(Object target,String methodName,Object... args){
        final Class[] typeArgs=new Class[null==args?0:args.length];
        if(null!=args && 0!=args.length)for(int i=0;i<args.length;typeArgs[i]=args[i].getClass(),i++);
        return findMethod(target, methodName, typeArgs);
    }
    
    /**
     * 查找类中的构造方法
     * @param target 对象
     * @param args 参数列表
     * @return 构造方法对象
     */
    public static final Constructor<?> findConstructor(Object target,Object... args){
        final Class[] typeArgs=new Class[null==args?0:args.length];
        if(null!=args && 0!=args.length)for(int i=0;i<args.length;typeArgs[i]=args[i].getClass(),i++);
        return findConstructor(target, typeArgs);
    }
    
    /**
     * 查找类或接口中的字段(含参数类对象)
     * @param type 接口类对象
     * @param fieldName 字段名
     * @return 字段对象
     */
    public static final Field findField(Object type,String fieldName){
        return findDeclaredField(ClassType.ALL,type,fieldName);
    }
    
    /**
     * 查找接口中的字段(含参数类对象)
     * @param type 接口类对象
     * @param fieldName 常量名
     * @return 字段对象
     */
    public static final Field findFieldByFace(Object type,String fieldName){
        return findDeclaredField(ClassType.FACE,type,fieldName);
    }
    
    /**
     * 查找类中的字段(含参数类对象)
     * @param type 类对象
     * @param fieldName 属性名
     * @return 字段对象
     */
    public static final Field findFieldByClass(Object type,String fieldName){
        return findDeclaredField(ClassType.CLASS,type,fieldName);
    }
    
    /**
     * 查找类或接口世系树中的字段(含参数类对象)
     * @param kindType 查找模式
     * @param classType 查找类型
     * @param fieldName 字段名称
     * @return 字段对象
     */
    public static final Field findDeclaredField(ClassType kindType,Object classType,String fieldName){
        if(null==classType || null==fieldName || fieldName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            Field targetField=null;
            Field[] fields=type.getDeclaredFields();
            for(Field field:fields){
                if(!(fieldName.equals(field.getName()))) continue;
                targetField=field;
                break;
            }
            
            if(null!=targetField) {
                targetField.setAccessible(true);
                return targetField;
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetField=findDeclaredField(kindType,finalSuperClass,fieldName);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetField=findDeclaredField(kindType,finalSuperFaces,fieldName);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetField=findDeclaredField(kindType,finalAllTypes,fieldName);
            }
            
            if(null==targetField) continue;
            return targetField;
        }
        return null;
    }
    
    /**
     * 查找当前类及超类世系树中的所有字段(含参数类对象)
     * @param classType 查找类型
     * @return 字段名称到字段对象的映射字典
     * @description 扩展类将覆盖基类同名字段
     */
    public static final HashMap<String,Field> findFieldsByType(Object classType){
        return findFields(ClassType.CLASS,classType);
    }
    
    /**
     * 查找当前类及超接口世系树中的所有字段(含参数类对象)
     * @param classType 查找类型
     * @return 字段名称到字段对象的映射字典
     * @description 扩展类将覆盖基类同名字段
     */
    public static final HashMap<String,Field> findFieldsByFace(Object classType){
        return findFields(ClassType.FACE,classType);
    }
    
    /**
     * 查找当前类或超类及超接口世系树中的所有字段(含参数类对象)
     * @param classType 查找类型
     * @return 字段名称到字段对象的映射字典
     * @description 扩展类将覆盖基类同名字段
     */
    public static final HashMap<String,Field> findFields(Object classType){
        return findFields(ClassType.ALL,classType);
    }
    
    /**
     * 查找类或接口世系树中的所有字段(含参数类对象)
     * @param kindType 查找模式
     * @param classType 查找类型
     * @return 字段名称到字段对象的映射字典
     * @description 扩展类将覆盖基类同名字段
     */
    public static final HashMap<String,Field> findFields(ClassType kindType,Object classType){
        if(null==classType) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        HashMap<String,Field> subMap=new HashMap<String,Field>();
        for(Class<?> type:types){
            for(Field field:type.getDeclaredFields()) {
                field.setAccessible(true);
                subMap.putIfAbsent(field.getName(), field);
            }
            
            HashMap<String,Field> parentMap=null;
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                parentMap=findFields(kindType,finalSuperClass);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                parentMap=findFields(kindType,finalSuperFaces);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                parentMap=findFields(kindType,finalAllTypes);
            }
            
            if(null==parentMap) continue;
            for(Map.Entry entry:parentMap.entrySet()) subMap.putIfAbsent((String)entry.getKey(), (Field)entry.getValue());
        }
        return subMap;
    }
    
    /**
     * 查找类或接口中的第一个方法
     * 若方法重载多次则返回的方法是不确定的
     * @param type 类或接口类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findFirstMethod(Object type,String methodName){
        return findFirstDeclaredMethod(ClassType.ALL,type,methodName);
    }
    
    /**
     * 查找类或接口中的方法
     * @param type 类或接口类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findMethod(Object type,String methodName,Class<?>... paramTypes){
        return findDeclaredMethod(ClassType.ALL,type,methodName,paramTypes);
    }
    
    /**
     * 查找类中的第一个方法
     * 若方法重载多次则返回的方法是不确定的
     * @param type 类类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findFirstMethodByClass(Object type,String methodName){
        return findFirstDeclaredMethod(ClassType.CLASS,type,methodName);
    }
    
    /**
     * 查找类中的方法
     * @param type 类类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findMethodByClass(Object type,String methodName,Class<?>... paramTypes){
        return findDeclaredMethod(ClassType.CLASS,type,methodName,paramTypes);
    }
    
    /**
     * 查找接口中的第一个方法
     * 若方法重载多次则返回的方法是不确定的
     * @param type 接口类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findFirstMethodByFace(Object type,String methodName){
        return findFirstDeclaredMethod(ClassType.FACE,type,methodName);
    }
    
    /**
     * 查找接口中的方法
     * @param type 接口类型
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findMethodByFace(Object type,String methodName,Class<?>... paramTypes){
        return findDeclaredMethod(ClassType.FACE,type,methodName,paramTypes);
    }
    
    /**
     * 查找类或接口世系树中的第一个方法(含参数类对象)
     * @param kindType 递归通道(类、接口、所有)
     * @param classType 类型数组
     * @param methodName 方法名
     * @return 方法对象
     */
    public static final Method findFirstDeclaredMethod(ClassType kindType,Object classType,String methodName){
        if(null==classType || null==methodName || methodName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            Method targetMethod=null;
            Method[] methods=type.getDeclaredMethods();
            for(Method method:methods){
                if(!(methodName.equals(method.getName()))) continue;
                targetMethod=method;
                break;
            }
            
            if(null!=targetMethod) {
                targetMethod.setAccessible(true);
                return targetMethod;
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetMethod=findFirstDeclaredMethod(kindType,finalSuperClass,methodName);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetMethod=findFirstDeclaredMethod(kindType,finalSuperFaces,methodName);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetMethod=findFirstDeclaredMethod(kindType,finalAllTypes,methodName);
            }
            
            if(null==targetMethod) continue;
            return targetMethod;
        }
        return null;
    }
    
    /**
     * 查找类或接口世系树中的方法(含参数类对象)
     * @param kindType 递归通道(类、接口、所有)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Method findDeclaredMethod(ClassType kindType,Object classType,String methodName,Class<?>... paramTypes){
        if(null==classType || null==methodName || methodName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            Method targetMethod=null;
            Method[] methods=type.getDeclaredMethods();
            out:for(Method method:methods){
                if(!(methodName.equals(method.getName()))) continue out;
                int argCount=method.getParameterCount();
                if(0==argCount) {
                    if(null==paramTypes || 0==paramTypes.length){
                        targetMethod=method;
                        break out;
                    }
                    continue out;
                }else{
                    if(null==paramTypes || argCount!=paramTypes.length) continue out;
                    if(!compatible(method.getParameterTypes(),paramTypes))  continue out;
                    targetMethod=method;
                    break out;
                }
            }
            
            if(null!=targetMethod) {
                targetMethod.setAccessible(true);
                return targetMethod;
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetMethod=findDeclaredMethod(kindType,finalSuperClass,methodName,paramTypes);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetMethod=findDeclaredMethod(kindType,finalSuperFaces,methodName,paramTypes);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetMethod=findDeclaredMethod(kindType,finalAllTypes,methodName,paramTypes);
            }
            
            if(null==targetMethod) continue;
            return targetMethod;
        }
        return null;
    }
    
    /**
     * 获取类或接口世系树中的所有方法(含参数类对象)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Set<Method> getDeclaredMethods(Object classType,String methodName,Class<?>... paramTypes){
        return getDeclaredMethods(ClassType.ALL,classType,methodName,paramTypes);
    }
    
    /**
     * 获取类世系树中的所有方法(含参数类对象)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Set<Method> getDeclaredMethodsByClass(Object classType,String methodName,Class<?>... paramTypes){
        return getDeclaredMethods(ClassType.CLASS,classType,methodName,paramTypes);
    }
    
    /**
     * 获取接口世系树中的所有方法(含参数类对象)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Set<Method> getDeclaredMethodsByFace(Object classType,String methodName,Class<?>... paramTypes){
        return getDeclaredMethods(ClassType.FACE,classType,methodName,paramTypes);
    }
    
    /**
     * 获取类或接口世系树中的所有方法(含参数类对象)
     * @param kindType 递归通道(类、接口、所有)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param paramsType 参数列表
     * @return 方法对象
     */
    public static final Set<Method> getDeclaredMethods(ClassType kindType,Object classType,String methodName,Class<?>... paramTypes){
        return getDeclaredMethods(kindType,classType,methodName,new HashSet<Method>(),paramTypes);
    }
    
    /**
     * 获取类或接口世系树中的所有方法(含参数类对象)
     * 返回世系树中相同方法名和参数列表的所有方法组成的集合
     * @param kindType 递归通道(类、接口、所有)
     * @param classType 类型数组
     * @param methodName 方法名
     * @param methodSet 方法集
     * @param paramsType 参数列表
     * @return 方法对象
     */
    private static final Set<Method> getDeclaredMethods(ClassType kindType,Object classType,String methodName,Set<Method> methodSet,Class<?>... paramTypes){
        if(null==classType || null==methodName || methodName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            Method[] methods=type.getDeclaredMethods();
            out:for(Method method:methods){
                if(!(methodName.equals(method.getName()))) continue out;
                int argCount=method.getParameterCount();
                if(0==argCount) {
                    if(null==paramTypes || 0==paramTypes.length){
                        method.setAccessible(true);
                        methodSet.add(method);
                        break out;
                    }
                    continue out;
                }else{
                    if(null==paramTypes || argCount!=paramTypes.length) continue out;
                    if(!compatible(method.getParameterTypes(),paramTypes))  continue out;
                    method.setAccessible(true);
                    methodSet.add(method);
                    break out;
                }
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                getDeclaredMethods(kindType,finalSuperClass,methodName,methodSet,paramTypes);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                getDeclaredMethods(kindType,finalSuperFaces,methodName,methodSet,paramTypes);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                getDeclaredMethods(kindType,finalAllTypes,methodName,methodSet,paramTypes);
            }
            continue;
        }
        return methodSet;
    }
    
    /**
     * 查找类或接口世系树中的所有标准SET方法(含参数类对象)
     * @param classType 查找类型
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Set<Method>> findSetMethods(Object classType){
        HashMap<String,Set<Method>> map=findPrefixMethods(classType,"set",true);
        if(null==map || 0==map.size()) return null;
        
        HashMap<String,Set<Method>> retMap=new HashMap<String,Set<Method>>();
        for(Map.Entry<String, Set<Method>> entry:map.entrySet()){
            for(Method method:entry.getValue()){
                if(!Modifier.isPublic(method.getModifiers())) continue;
                Class<?> returnType=method.getReturnType();
                if(void.class!=returnType && Void.class!=returnType) continue;
                if(1!=method.getParameterCount()) continue;
                String methodName=entry.getKey();
                Set<Method> methodSet=retMap.get(methodName);
                if(null==methodSet) retMap.put(methodName, methodSet=new HashSet<Method>());
                methodSet.add(method);
            }
        }
        return retMap;
    }
    
    /**
     * 查找类或接口世系树中的所有标准GET方法(含参数类对象)
     * @param classType 查找类型
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Method> findGetMethods(Object classType){
        HashMap<String,Set<Method>> map=findPrefixMethods(classType,"get",true);
        if(null==map || 0==map.size()) return null;
        
        HashMap<String,Method> retMap=new HashMap<String,Method>();
        for(Map.Entry<String, Set<Method>> entry:map.entrySet()){
            for(Method method:entry.getValue()){
                if(!Modifier.isPublic(method.getModifiers())) continue;
                Class<?> returnType=method.getReturnType();
                if(void.class==returnType||Void.class==returnType) continue;
                if(0!=method.getParameterCount()) continue;
                retMap.put(entry.getKey(),method);
            }
        }
        return retMap;
    }
    
    /**
     * 查找类或接口世系树中的所有方法(含参数类对象)
     * @param classType 查找类型
     * @param prefixs 查找方法名前缀
     * @param compatibles 是否按类型兼容排重(默认为false)
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     * 方法名前缀通常为get/set/add/create/del/remove/mod/update/is/has/enable/disable等
     */
    public static final HashMap<String,Set<Method>> findPrefixMethods(Object classType,String prefixs,boolean... compatibles){
        if(null==classType || null==prefixs || 0==prefixs.trim().length()) return null;
        String prefix=prefixs.trim();
        HashMap<String, Set<Method>> prefixMethodMap=new HashMap<String, Set<Method>>();
        HashMap<String, Set<Method>> allMethodMap=findMethods(ClassType.ALL,classType,compatibles);
        for(Map.Entry<String, Set<Method>> entry:allMethodMap.entrySet()){
            String methodName=entry.getKey();
            if(!methodName.startsWith(prefix)) continue;
            prefixMethodMap.put(methodName, entry.getValue());
        }
        return prefixMethodMap;
    }
    
    /**
     * 查找当前类及超类世系树中的所有方法(含参数类对象)
     * @param classType 查找类型
     * @param compatibles 是否按类型兼容排重(默认为false)
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Set<Method>> findMethodsByType(Object classType,boolean... compatibles){
        return findMethods(ClassType.CLASS,classType,compatibles);
    }
    
    /**
     * 查找当前类及超接口世系树中的所有方法(含参数类对象)
     * @param classType 查找类型
     * @param compatibles 是否按类型兼容排重(默认为false)
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Set<Method>> findMethodsByFace(Object classType,boolean... compatibles){
        return findMethods(ClassType.FACE,classType,compatibles);
    }
    
    /**
     * 查找类或接口世系树中的所有方法(含参数类对象)
     * @param classType 查找类型
     * @param compatibles 是否按类型兼容排重(默认为false)
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Set<Method>> findMethods(Object classType,boolean... compatibles){
        return findMethods(ClassType.ALL,classType,compatibles);
    }
    
    /**
     * 查找类或接口世系树中的所有方法(含参数类对象)
     * @param kindType 查找模式
     * @param classType 查找类型
     * @param compatibles 是否按类型兼容排重(默认为false)
     * @return 方法名称到方法对象的映射字典
     * @description 扩展类将覆盖基类同名同参数列表方法
     */
    public static final HashMap<String,Set<Method>> findMethods(ClassType kindType,Object classType,boolean... compatibles){
        if(null==classType) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        HashMap<String,Set<Method>> subMap=new HashMap<String,Set<Method>>();
        boolean compatible=null==compatibles||0==compatibles.length?false:compatibles[0];
        
        for(Class<?> type:types){
            out:for(Method method:type.getDeclaredMethods()) {
                method.setAccessible(true);
                String methodName=method.getName();
                Set<Method> set=subMap.get(methodName);
                if(null==set) subMap.put(methodName, set=new HashSet());
                if(compatible){
                    for(Method imethod:set) if(compatible(imethod.getParameterTypes(),method.getParameterTypes()))  continue out;
                }else{
                    for(Method imethod:set) if(Arrays.equals(method.getParameterTypes(),imethod.getParameterTypes())) continue out;
                }
                set.add(method);
            }
            
        HashMap<String,Set<Method>> parentMap=null;
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                parentMap=findMethods(kindType,finalSuperClass);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                parentMap=findMethods(kindType,finalSuperFaces);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                parentMap=findMethods(kindType,finalAllTypes);
            }
            
            if(null==parentMap) continue;
            out:for(Map.Entry entry:parentMap.entrySet()) {
                String methodName=(String)entry.getKey();
                Method method=(Method)entry.getValue();
                Set<Method> set=subMap.get(methodName);
                if(null==set) subMap.put(methodName, set=new HashSet());
                if(compatible){
                    for(Method imethod:set) if(compatible(imethod.getParameterTypes(),method.getParameterTypes()))  continue out;
                }else{
                    for(Method imethod:set) if(Arrays.equals(method.getParameterTypes(),imethod.getParameterTypes())) continue out;
                }
                set.add(method);
            }
        }
        return subMap;
    }
    
    /**
     * 查找类中的第一个构造方法
     * 若重载多次构造则返回的构造方法是不确定的
     * @param type 类型
     * @return 构造方法对象
     */
    public static final Constructor<?> findFirstConstructor(Object classType){
        if(null==classType) return null;
        Class<?> type=Class.class.isInstance(classType)?(Class<?>)classType:classType.getClass();
        Constructor<?> constructor=type.getDeclaredConstructors()[0];
        constructor.setAccessible(true);
        return constructor;
    }
    
    /**
     * 查找类中的第一个公共构造方法
     * 若重载多次构造则返回的构造方法是不确定的
     * @param classType 类对象
     * @return 构造方法对象
     */
    public static final Constructor<?> findFirstPublicConstructor(Object classType){
        if(null==classType) return null;
        Class<?> type=Class.class.isInstance(classType)?(Class<?>)classType:classType.getClass();
        Constructor<?>[] constructors=type.getConstructors();
        if(null==constructors||0==constructors.length) return null;
        Constructor<?> constructor=constructors[0];
        constructor.setAccessible(true);
        return constructor;
    }
    
    /**
     * 查找类中的构造方法
     * @param type 类对象
     * @param paramsType 参数列表
     * @return 构造方法对象
     */
    public static final Constructor<?> findConstructor(Object classType,Class<?>... paramTypes){
        if(null==classType) return null;
        Constructor<?> targetConstructor=null;
        Class<?> type=Class.class.isInstance(classType)?(Class<?>)classType:classType.getClass();
        
        Constructor<?>[] constructors=type.getDeclaredConstructors();
        out:for(Constructor<?> constructor:constructors){
            int argCount=constructor.getParameterCount();
            if(0==argCount) {
                if(null==paramTypes || 0==paramTypes.length){
                    targetConstructor=constructor;
                    break out;
                }
                continue out;
            }else{
                if(null==paramTypes || argCount!=paramTypes.length) continue out;
                Class<?>[] curMethodTypes=constructor.getParameterTypes();
                for(int i=0;i<paramTypes.length;i++){
                    Class<?> paramType=paramTypes[i];
                    Class<?> curMethodType=curMethodTypes[i];
                    if(!compatible(curMethodType,paramType)) continue out;
                }
                targetConstructor=constructor;
                break out;
            }
        }
        
        if(null!=targetConstructor) targetConstructor.setAccessible(true);
        return targetConstructor;
    }
    
    /**
     * 查找类或世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param args 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotation(Object classType,String methodName,Class<R> annotationType,Object... args){
        return findMethodAnnotation(ClassType.ALL,classType,methodName,annotationType,args);
    }
    
    /**
     * 查找类世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param args 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotationByClass(Object classType,String methodName,Class<R> annotationType,Object... args){
        return findMethodAnnotation(ClassType.CLASS,classType,methodName,annotationType,args);
    }
    
    /**
     * 查找接口世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param args 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotationByFace(Object classType,String methodName,Class<R> annotationType,Object... args){
        return findMethodAnnotation(ClassType.FACE,classType,methodName,annotationType,args);
    }
    
    /**
     * 查找类或接口世系树中方法上的注解
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param args 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findMethodAnnotation(ClassType kindType,Object classType,String methodName,Class<R> annotationType,Object... args){
        final Class[] typeArgs=new Class[null==args?0:args.length];
        if(null!=args && 0!=args.length)for(int i=0;i<args.length;typeArgs[i]=args[i].getClass(),i++);
        return findMethodAnnotation(kindType,classType,methodName,annotationType,typeArgs);
    }
    
    /**
     * 查找类或接口中第一个方法上的注解
     * 如果重载了多个方法则查找的注解是不确定的
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findFirstAnnotation(Object classType,String methodName,Class<R> annotationType){
        return findFirstMethodAnnotation(ClassType.ALL,classType,methodName,annotationType);
    }
    
    /**
     * 查找类中第一个方法上的注解
     * 如果重载了多个方法则查找的注解是不确定的
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findFirstAnnotationByClass(Object classType,String methodName,Class<R> annotationType){
        return findFirstMethodAnnotation(ClassType.CLASS,classType,methodName,annotationType);
    }
    
    /**
     * 查找接口中第一个方法上的注解
     * 如果重载了多个方法则查找的注解是不确定的
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findFirstAnnotationByFace(Object classType,String methodName,Class<R> annotationType){
        return findFirstMethodAnnotation(ClassType.FACE,classType,methodName,annotationType);
    }
    
    /**
     * 查找类或接口中第一个方法上的注解
     * 如果重载了多个方法则查找的注解是不确定的
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findFirstMethodAnnotation(ClassType kindType,Object classType,String methodName,Class<R> annotationType){
        if(null==classType || null==methodName || null==annotationType || methodName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        R targetAnnotation=null;
        for(Class<?> type:types){
            Method targetMethod=null;
            Method[] methods=type.getDeclaredMethods();
            for(Method method:methods){
                if(!(methodName.equals(method.getName()))) continue;
                targetMethod=method;
                break;
            }
            
            if(null!=targetMethod) {
                targetMethod.setAccessible(true);
                targetAnnotation=findOneLayerAnnotation(targetMethod,annotationType);
                if(null!=targetAnnotation) return targetAnnotation;
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetAnnotation=findMethodAnnotation(kindType,finalSuperClass,methodName,annotationType);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetAnnotation=findMethodAnnotation(kindType,finalSuperFaces,methodName,annotationType);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetAnnotation=findMethodAnnotation(kindType,finalAllTypes,methodName,annotationType);
            }
            
            if(null==targetAnnotation) continue;
            return targetAnnotation;
        }
        return null;
    }
    
    /**
     * 查找类或接口世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotation(Object classType,String methodName,Class<R> annotationType,Class<?>... argTypes){
        return findMethodAnnotation(ClassType.ALL,classType,methodName,annotationType,argTypes);
    }
    
    /**
     * 查找类世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotationByClass(Object classType,String methodName,Class<R> annotationType,Class<?>... argTypes){
        return findMethodAnnotation(ClassType.CLASS,classType,methodName,annotationType,argTypes);
    }
    
    /**
     * 查找接口世系树中方法上的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findAnnotationByFace(Object classType,String methodName,Class<R> annotationType,Class<?>... argTypes){
        return findMethodAnnotation(ClassType.FACE,classType,methodName,annotationType,argTypes);
    }
    
    /**
     * 查找类或接口世系树中方法上的注解
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationType 注解类型
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final <R extends Annotation> R findMethodAnnotation(ClassType kindType,Object classType,String methodName,Class<R> annotationType,Class<?>... paramTypes){
        if(null==classType || null==methodName || null==annotationType || methodName.trim().isEmpty()) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        R targetAnnotation=null;
        for(Class<?> type:types){
            Method targetMethod=null;
            Method[] methods=type.getDeclaredMethods();
            out:for(Method method:methods){
                if(!(methodName.equals(method.getName()))) continue out;
                int argCount=method.getParameterCount();
                if(0==argCount) {
                    if(null==paramTypes || 0==paramTypes.length){
                        targetMethod=method;
                        break out;
                    }
                    continue out;
                }else{
                    if(null==paramTypes || argCount!=paramTypes.length) continue out;
                    Class<?>[] curMethodTypes=method.getParameterTypes();
                    for(int i=0;i<paramTypes.length;i++){
                        Class<?> paramType=paramTypes[i];
                        Class<?> curMethodType=curMethodTypes[i];
                        if(!compatible(curMethodType,paramType)) continue out;
                    }
                    targetMethod=method;
                    break out;
                }
            }
            
            if(null!=targetMethod) {
                targetMethod.setAccessible(true);
                targetAnnotation=findOneLayerAnnotation(targetMethod,annotationType);
                if(null!=targetAnnotation) return targetAnnotation;
            }
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetAnnotation=findMethodAnnotation(kindType,finalSuperClass,methodName,annotationType,paramTypes);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetAnnotation=findMethodAnnotation(kindType,finalSuperFaces,methodName,annotationType,paramTypes);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetAnnotation=findMethodAnnotation(kindType,finalAllTypes,methodName,annotationType,paramTypes);
            }
            
            if(null==targetAnnotation) continue;
            return targetAnnotation;
        }
        return null;
    }
    
    /**
     * 类或接口世系树中方法上是否包含指定的注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationTypes 是否被包含的注解
     * @param argTypes 参数列表
     * @return 是否包含指定的注解
     */
    public static final <R extends Annotation> Boolean containsAnnotation(Object classType,String methodName,Class<R> annotationType,Class<?>... argTypes){
        Set<Annotation> annotationSet=getMethodAnnotations(classType,methodName,argTypes);
        Set<Class<? extends Annotation>> annotationTypeSet=annotationSet.stream().map(annotation->annotation.annotationType()).collect(Collectors.toSet());
        return annotationTypeSet.contains(annotationType);
    }
    
    /**
     * 类或接口世系树中方法上是否包含参数注解集中的所有注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationTypes 是否被包含的参数注解集
     * @param argTypes 参数列表
     * @return 是否包含参数注解集中的所有注解
     */
    public static final <R extends Annotation> Boolean containsAllAnnotation(Object classType,String methodName,Class<R>[] annotationTypes,Class<?>... argTypes){
        Set<Annotation> annotationSet=getMethodAnnotations(classType,methodName,argTypes);
        Set<Class<? extends Annotation>> annotationTypeSet=annotationSet.stream().map(annotation->annotation.annotationType()).collect(Collectors.toSet());
        return annotationTypeSet.containsAll(new HashSet(Arrays.asList(annotationTypes)));
    }
    
    /**
     * 类或接口世系树中方法上是否至少包含参数注解集中的其中一个注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param annotationTypes 是否被包含的参数注解集
     * @param argTypes 参数列表
     * @return 是否至少包含参数注解集中的其中一个注解
     */
    public static final <R extends Annotation> Boolean containsAnyAnnotation(Object classType,String methodName,Class<R>[] annotationTypes,Class<?>... argTypes){
        Set<Annotation> annotationSet=getMethodAnnotations(classType,methodName,argTypes);
        Set<Class<? extends Annotation>> annotationTypeSet=annotationSet.stream().map(annotation->annotation.annotationType()).collect(Collectors.toSet());
        for(Class<R> condiType:annotationTypes) if(annotationTypeSet.contains(condiType)) return true;
        return false;
    }
    
    /**
     * 查找类或接口世系树中方法上的所有注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final HashSet<Annotation> getMethodAnnotations(Object classType,String methodName,Class<?>... argTypes){
        return getMethodAnnotations(ClassType.ALL,classType,methodName,argTypes);
    }
    
    /**
     * 查找类世系树中方法上的所有注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final HashSet<Annotation> getMethodAnnotationsByClass(Object classType,String methodName,Class<?>... argTypes){
        return getMethodAnnotations(ClassType.CLASS,classType,methodName,argTypes);
    }
    
    /**
     * 查找接口世系树中方法上的所有注解
     * @param classType 类对象
     * @param methodName 方法名
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final HashSet<Annotation> getMethodAnnotationsByFace(Object classType,String methodName,Class<?>... argTypes){
        return getMethodAnnotations(ClassType.FACE,classType,methodName,argTypes);
    }
    
    /**
     * 查找类或接口世系树中方法上的所有注解
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param methodName 方法名
     * @param argTypes 参数列表
     * @return 注解
     */
    public static final HashSet<Annotation> getMethodAnnotations(ClassType kindType,Object classType,String methodName,Class<?>... argTypes){
        HashSet<Annotation> annotationSet=new HashSet<Annotation>();
        Set<Method> methods=getDeclaredMethods(kindType,classType,methodName,argTypes);
        for(Method method:methods){
            Annotation[] annotations=findAnnotations(method);
            if(null!=annotations&&0!=annotations.length)annotationSet.addAll(Arrays.asList(annotations));
        }
        return annotationSet;
    }
    
    /**
     * 查找类或接口世系树上的注解(含参数类对象)
     * @param classType 类对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R> R findAnnotation(Object classType,Class<R> annotationType){
        return findTypeAnnotation(ClassType.ALL,classType,annotationType);
    }
    
    /**
     * 查找类世系树上的注解(含参数类对象)
     * @param classType 类对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R> R findAnnotationByClass(Object classType,Class<R> annotationType){
        return findTypeAnnotation(ClassType.CLASS,classType,annotationType);
    }
    
    /**
     * 查找接口世系树上的注解(含参数类对象)
     * @param classType 类对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R> R findAnnotationByFace(Object classType,Class<R> annotationType){
        return findTypeAnnotation(ClassType.FACE,classType,annotationType);
    }
    
    /**
     * 查找类或接口世系树上的注解(含参数类对象)
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R> R findTypeAnnotation(ClassType kindType,Object classType,Class<R> annotationType){
        if(null==classType || null==annotationType) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            R targetAnnotation=null;
            Annotation[] annotations=findAnnotations(type);
            if(null!=annotations&&0!=annotations.length) {
                for(Annotation annotation:annotations){
                    if(!annotationType.isInstance(annotation)) continue;
                    targetAnnotation=(R)annotation;
                    break;
                }
            }
            
            if(null!=targetAnnotation) return targetAnnotation;
            
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                targetAnnotation=findTypeAnnotation(kindType,finalSuperClass,annotationType);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                targetAnnotation=findTypeAnnotation(kindType,finalSuperFaces,annotationType);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                targetAnnotation=findTypeAnnotation(kindType,finalAllTypes,annotationType);
            }
            
            if(null==targetAnnotation) continue;
            return targetAnnotation;
        }
        return null;
    }
    
    /**
     * 获取类或接口世系树上所有注解(含参数类对象)
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param annotationSet 注解集合(通常为null)
     * @return 注解集合
     */
    public static final Set<Annotation> getTypeAnnotations(ClassType kindType,Object classType){
        return getTypeAnnotations(kindType,classType,new HashSet<Annotation>());
    }
    
    /**
     * 获取类或接口世系树上所有注解(含参数类对象)
     * @param kindType 递归类型(类、接口、所有)
     * @param classType 类对象
     * @param annotationSet 注解集合
     * @return 注解集合
     */
    private static final Set<Annotation> getTypeAnnotations(ClassType kindType,Object classType,Set<Annotation> annotationSet){
        if(null==classType) return null;
        
        Class<?>[] types=null;
        if(!Class.class.isInstance(classType) && !Class[].class.isInstance(classType)) {
            types=new Class<?>[]{classType.getClass()};
        }else{
            types=Class[].class.isInstance(classType)?(Class<?>[])classType:new Class<?>[]{(Class<?>)classType};
        }
        if(null==types||0==types.length) return null;
        
        for(Class<?> type:types){
            Annotation[] annotations=findAnnotations(type);
            if(null!=annotations&&0!=annotations.length) annotationSet.addAll(Arrays.asList(annotations));
            if(ClassType.CLASS==kindType){
                Class<?> superClass=type.getSuperclass();
                Class<?>[] finalSuperClass=null==superClass?null:new Class<?>[]{superClass};
                getTypeAnnotations(kindType,finalSuperClass,annotationSet);
            }else if(ClassType.FACE==kindType){
                Class<?>[] superFaces=type.getInterfaces();
                Class<?>[] finalSuperFaces=null==superFaces||0==superFaces.length?null:superFaces;
                getTypeAnnotations(kindType,finalSuperFaces,annotationSet);
            }else{
                Class<?>[] finalAllTypes=null;
                Class<?> superClass=type.getSuperclass();
                Class<?>[] superFaces=type.getInterfaces();
                if(null==superFaces||0==superFaces.length){
                    if(null==superClass){
                        finalAllTypes=null;
                    }else{
                        finalAllTypes=new Class<?>[]{superClass};
                    }
                }else{
                    if(null==superClass){
                        finalAllTypes=superFaces;
                    }else{
                        finalAllTypes=new Class<?>[superFaces.length+1];
                        finalAllTypes[0]=superClass;
                        System.arraycopy(superFaces, 0, finalAllTypes, 1, superFaces.length);
                    }
                }
                getTypeAnnotations(kindType,finalAllTypes,annotationSet);
            }
            continue;
        }
        return annotationSet;
    }
    
    /**
     * 查找指定类或接口上的注解
     * @param type 类对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findOneLayerAnnotation(Object classType,Class<R> annotationType){
        if(null==classType||null==annotationType) return null;
        Class<?> type=Class.class.isInstance(classType)?(Class<?>)classType:classType.getClass();
        Annotation[] annotations=findAnnotations(type);
        if(null==annotations) return null;
        for(Annotation annotation:annotations)
        if(annotationType.isInstance(annotation)) return (R)annotation;
        return null;
    }
    
    /**
     * 查找指定方法上的注解
     * @param method 方法对象
     * @param annotationType 注解类型
     * @return 注解
     */
    public static final <R extends Annotation> R findOneLayerAnnotation(Method method,Class<R> annotationType){
        if(null==method||null==annotationType) return null;
        Annotation[] annotations=findAnnotations(method);
        if(null==annotations) return null;
        for(Annotation annotation:annotations)
        if(annotationType.isInstance(annotation)) return (R)annotation;
        return null;
    }
    
    /**
     * 查找指定类或接口上的所有注解
     * @param type 类对象
     * @return 注解数组
     */
    public static final Annotation[] findAnnotations(Class<?> type){
        if(null==type) return null;
        return type.getAnnotations();
    }
    
    /**
     * 查找指定方法上的所有注解
     * @param method 方法对象
     * @return 注解数组
     */
    public static final Annotation[] findAnnotations(Method method){
        if(null==method) return null;
        return method.getAnnotations();
    }
}