yangys
2024-03-31 2969df3e404db3cd116f27db1495e523ce05bf86
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
package com.qianwen.core.tool.utils;
 
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.Closeable;
import java.io.File;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.Temporal;
import java.time.temporal.TemporalAccessor;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import com.qianwen.core.tool.jackson.JsonUtil;
import org.springframework.beans.BeansException;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.lang.Nullable;
import org.springframework.util.PatternMatchUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.method.HandlerMethod;
 
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/utils/Func.class */
public class Func {
    public static final String DATE_FORMAT_DEFAULT = "yyyy-MM-dd";
    public static final String DATETIME_FORMAT_DEFAULT = "yyyy-MM-dd HH:mm:ss";
 
    public static <T> T requireNotNull(T obj) {
        return (T) Objects.requireNonNull(obj);
    }
 
    public static <T> T requireNotNull(T obj, String message) {
        return (T) Objects.requireNonNull(obj, message);
    }
 
    public static <T> T requireNotNull(T obj, Supplier<String> messageSupplier) {
        return (T) Objects.requireNonNull(obj, messageSupplier);
    }
 
    public static boolean isNull(@Nullable Object obj) {
        return Objects.isNull(obj);
    }
 
    public static boolean notNull(@Nullable Object obj) {
        return Objects.nonNull(obj);
    }
 
    public static String firstCharToLower(String str) {
        return StringUtil.firstCharToLower(str);
    }
 
    public static String firstCharToUpper(String str) {
        return StringUtil.firstCharToUpper(str);
    }
 
    public static boolean isBlank(@Nullable final CharSequence cs) {
        return StringUtil.isBlank(cs);
    }
 
    public static boolean isNotBlank(@Nullable final CharSequence cs) {
        return StringUtil.isNotBlank(cs);
    }
 
    public static boolean isAnyBlank(final CharSequence... css) {
        return StringUtil.isAnyBlank(css);
    }
 
    public static boolean isNoneBlank(final CharSequence... css) {
        return StringUtil.isNoneBlank(css);
    }
 
    public static boolean isArray(@Nullable Object obj) {
        return ObjectUtil.isArray(obj);
    }
 
    public static boolean isEmpty(@Nullable Object obj) {
        return ObjectUtil.isEmpty(obj);
    }
 
    public static boolean isNotEmpty(@Nullable Object obj) {
        return !ObjectUtil.isEmpty(obj);
    }
 
    public static boolean isEmpty(@Nullable Object[] array) {
        return ObjectUtil.isEmpty(array);
    }
 
    public static boolean isNotEmpty(@Nullable Object[] array) {
        return ObjectUtil.isNotEmpty(array);
    }
 
    public static boolean hasEmpty(Object... os) {
        for (Object o : os) {
            if (isEmpty(o)) {
                return true;
            }
        }
        return false;
    }
 
    public static boolean isAllEmpty(Object... os) {
        for (Object o : os) {
            if (isNotEmpty(o)) {
                return false;
            }
        }
        return true;
    }
 
    public static String format(@Nullable String message, @Nullable Map<String, ?> params) {
        return StringUtil.format(message, params);
    }
 
    public static String format(@Nullable String message, @Nullable Object... arguments) {
        return StringUtil.format(message, arguments);
    }
 
    public static String format(long nanos) {
        return StringUtil.format(nanos);
    }
 
    public static boolean equals(Object obj1, Object obj2) {
        return Objects.equals(obj1, obj2);
    }
 
    public static boolean equalsSafe(@Nullable Object o1, @Nullable Object o2) {
        return ObjectUtil.nullSafeEquals(o1, o2);
    }
 
    public static <T> boolean contains(@Nullable T[] array, final T element) {
        return CollectionUtil.contains(array, element);
    }
 
    public static boolean contains(@Nullable Iterator<?> iterator, Object element) {
        return CollectionUtil.contains(iterator, element);
    }
 
    public static boolean contains(@Nullable Enumeration<?> enumeration, Object element) {
        return CollectionUtil.contains(enumeration, element);
    }
 
    @SafeVarargs
    public static <E> Set<E> ofImmutableSet(E... es) {
        return CollectionUtil.ofImmutableSet(es);
    }
 
    @SafeVarargs
    public static <E> List<E> ofImmutableList(E... es) {
        return CollectionUtil.ofImmutableList(es);
    }
 
    public static String toStr(Object str) {
        return toStr(str, StringPool.EMPTY);
    }
 
    public static String toStr(Object str, String defaultValue) {
        if (null == str || str.equals(StringPool.NULL)) {
            return defaultValue;
        }
        return String.valueOf(str);
    }
 
    public static String toStrWithEmpty(Object str, String defaultValue) {
        if (null == str || str.equals(StringPool.NULL) || str.equals(StringPool.EMPTY)) {
            return defaultValue;
        }
        return String.valueOf(str);
    }
 
    public static boolean isNumeric(final CharSequence cs) {
        return StringUtil.isNumeric(cs);
    }
 
    public static int toInt(final Object str) {
        return NumberUtil.toInt(String.valueOf(str));
    }
 
    public static int toInt(@Nullable final Object str, final int defaultValue) {
        return NumberUtil.toInt(String.valueOf(str), defaultValue);
    }
 
    public static long toLong(final Object str) {
        return NumberUtil.toLong(String.valueOf(str));
    }
 
    public static long toLong(@Nullable final Object str, final long defaultValue) {
        return NumberUtil.toLong(String.valueOf(str), defaultValue);
    }
 
    public static Double toDouble(Object value) {
        return toDouble(String.valueOf(value), Double.valueOf(-1.0d));
    }
 
    public static Double toDouble(Object value, Double defaultValue) {
        return NumberUtil.toDouble(String.valueOf(value), defaultValue);
    }
 
    public static Float toFloat(Object value) {
        return toFloat(String.valueOf(value), Float.valueOf(-1.0f));
    }
 
    public static Float toFloat(Object value, Float defaultValue) {
        return NumberUtil.toFloat(String.valueOf(value), defaultValue);
    }
 
    public static Boolean toBoolean(Object value) {
        return toBoolean(value, null);
    }
 
    public static Boolean toBoolean(Object value, Boolean defaultValue) {
        if (value != null) {
            String val = String.valueOf(value);
            return Boolean.valueOf(Boolean.parseBoolean(val.toLowerCase().trim()));
        }
        return defaultValue;
    }
 
    public static Integer[] toIntArray(String str) {
        return toIntArray(StringPool.COMMA, str);
    }
 
    public static Integer[] toIntArray(String split, String str) {
        if (StringUtil.isEmpty(str)) {
            return new Integer[0];
        }
        String[] arr = str.split(split);
        Integer[] ints = new Integer[arr.length];
        for (int i = 0; i < arr.length; i++) {
            Integer v = Integer.valueOf(toInt(arr[i], 0));
            ints[i] = v;
        }
        return ints;
    }
 
    public static List<Integer> toIntList(String str) {
        return Arrays.asList(toIntArray(str));
    }
 
    public static List<Integer> toIntList(String split, String str) {
        return Arrays.asList(toIntArray(split, str));
    }
 
    public static Integer firstInt(String str) {
        return firstInt(StringPool.COMMA, str);
    }
 
    public static Integer firstInt(String split, String str) {
        List<Integer> ints = toIntList(split, str);
        if (isEmpty(ints)) {
            return null;
        }
        return ints.get(0);
    }
 
    public static Long[] toLongArray(String str) {
        return toLongArray(StringPool.COMMA, str);
    }
 
    public static Long[] toLongArray(String split, String str) {
        if (StringUtil.isEmpty(str)) {
            return new Long[0];
        }
        String[] arr = str.split(split);
        Long[] longs = new Long[arr.length];
        for (int i = 0; i < arr.length; i++) {
            Long v = Long.valueOf(toLong(arr[i], 0L));
            longs[i] = v;
        }
        return longs;
    }
 
    public static List<Long> toLongList(String str) {
        return Arrays.asList(toLongArray(str));
    }
 
    public static List<Long> toLongList(List<String> str) {
        return (List) str.stream().map(s -> {
            return Long.valueOf(Long.parseLong(s.trim()));
        }).collect(Collectors.toList());
    }
 
    public static List<Long> toLongList(String split, String str) {
        return Arrays.asList(toLongArray(split, str));
    }
 
    public static Long firstLong(String str) {
        return firstLong(StringPool.COMMA, str);
    }
 
    public static Long firstLong(String split, String str) {
        List<Long> longs = toLongList(split, str);
        if (isEmpty(longs)) {
            return null;
        }
        return longs.get(0);
    }
 
    public static String[] toStrArray(String str) {
        return toStrArray(StringPool.COMMA, str);
    }
 
    public static String[] toStrArray(String split, String str) {
        if (isBlank(str)) {
            return new String[0];
        }
        return str.split(split);
    }
 
    public static List<String> toStrList(String str) {
        return Arrays.asList(toStrArray(str));
    }
 
    public static List<String> toStrList(String split, String str) {
        return Arrays.asList(toStrArray(split, str));
    }
 
    public static String firstStr(String str) {
        return firstStr(StringPool.COMMA, str);
    }
 
    public static String firstStr(String split, String str) {
        List<String> strs = toStrList(split, str);
        if (isEmpty(strs)) {
            return null;
        }
        return strs.get(0);
    }
 
    public static String to62String(long num) {
        return NumberUtil.to62String(num);
    }
 
    public static String join(Collection<?> coll) {
        return StringUtil.join(coll);
    }
 
    public static String join(Collection<?> coll, String delim) {
        return StringUtil.join(coll, delim);
    }
 
    public static String join(Object[] arr) {
        return StringUtil.join(arr);
    }
 
    public static String join(Object[] arr, String delim) {
        return StringUtil.join(arr, delim);
    }
 
    public static List<String> split(CharSequence str, char separator) {
        return StringUtil.split(str, separator, -1);
    }
 
    public static List<String> splitTrim(CharSequence str, char separator) {
        return StringUtil.splitTrim(str, separator);
    }
 
    public static List<String> splitTrim(CharSequence str, CharSequence separator) {
        return StringUtil.splitTrim(str, separator);
    }
 
    public static String[] split(@Nullable String str, @Nullable String delimiter) {
        return StringUtil.delimitedListToStringArray(str, delimiter);
    }
 
    public static String[] splitTrim(@Nullable String str, @Nullable String delimiter) {
        return StringUtil.delimitedListToStringArray(str, delimiter, " \t\n\n\f");
    }
 
    public static boolean simpleMatch(@Nullable String pattern, @Nullable String str) {
        return PatternMatchUtils.simpleMatch(pattern, str);
    }
 
    public static boolean simpleMatch(@Nullable String[] patterns, String str) {
        return PatternMatchUtils.simpleMatch(patterns, str);
    }
 
    public static String randomUUID() {
        return StringUtil.randomUUID();
    }
 
    public static String escapeHtml(String html) {
        return StringUtil.escapeHtml(html);
    }
 
    public static String random(int count) {
        return StringUtil.random(count);
    }
 
    public static String random(int count, RandomType randomType) {
        return StringUtil.random(count, randomType);
    }
 
    public static String md5Hex(final String data) {
        return DigestUtil.md5Hex(data);
    }
 
    public static String md5Hex(final byte[] bytes) {
        return DigestUtil.md5Hex(bytes);
    }
 
    public static String sha1Hex(String data) {
        return DigestUtil.sha1Hex(data);
    }
 
    public static String sha1Hex(final byte[] bytes) {
        return DigestUtil.sha1Hex(bytes);
    }
 
    public static String sha224Hex(String data) {
        return DigestUtil.sha224Hex(data);
    }
 
    public static String sha224Hex(final byte[] bytes) {
        return DigestUtil.sha224Hex(bytes);
    }
 
    public static String sha256Hex(String data) {
        return DigestUtil.sha256Hex(data);
    }
 
    public static String sha256Hex(final byte[] bytes) {
        return DigestUtil.sha256Hex(bytes);
    }
 
    public static String sha384Hex(String data) {
        return DigestUtil.sha384Hex(data);
    }
 
    public static String sha384Hex(final byte[] bytes) {
        return DigestUtil.sha384Hex(bytes);
    }
 
    public static String sha512Hex(String data) {
        return DigestUtil.sha512Hex(data);
    }
 
    public static String sha512Hex(final byte[] bytes) {
        return DigestUtil.sha512Hex(bytes);
    }
 
    public static String hmacMd5Hex(String data, String key) {
        return DigestUtil.hmacMd5Hex(data, key);
    }
 
    public static String hmacMd5Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacMd5Hex(bytes, key);
    }
 
    public static String hmacSha1Hex(String data, String key) {
        return DigestUtil.hmacSha1Hex(data, key);
    }
 
    public static String hmacSha1Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacSha1Hex(bytes, key);
    }
 
    public static String hmacSha224Hex(String data, String key) {
        return DigestUtil.hmacSha224Hex(data, key);
    }
 
    public static String hmacSha224Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacSha224Hex(bytes, key);
    }
 
    public static String hmacSha256Hex(String data, String key) {
        return DigestUtil.hmacSha256Hex(data, key);
    }
 
    public static String hmacSha256Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacSha256Hex(bytes, key);
    }
 
    public static String hmacSha384Hex(String data, String key) {
        return DigestUtil.hmacSha384Hex(data, key);
    }
 
    public static String hmacSha384Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacSha384Hex(bytes, key);
    }
 
    public static String hmacSha512Hex(String data, String key) {
        return DigestUtil.hmacSha512Hex(data, key);
    }
 
    public static String hmacSha512Hex(final byte[] bytes, String key) {
        return DigestUtil.hmacSha512Hex(bytes, key);
    }
 
    public static String encodeHex(byte[] bytes) {
        return DigestUtil.encodeHex(bytes);
    }
 
    public static byte[] decodeHex(final String hexString) {
        return DigestUtil.decodeHex(hexString);
    }
 
    public static String encodeBase64(String value) {
        return Base64Util.encode(value);
    }
 
    public static String encodeBase64(String value, Charset charset) {
        return Base64Util.encode(value, charset);
    }
 
    public static String encodeBase64UrlSafe(String value) {
        return Base64Util.encodeUrlSafe(value);
    }
 
    public static String encodeBase64UrlSafe(String value, Charset charset) {
        return Base64Util.encodeUrlSafe(value, charset);
    }
 
    public static String decodeBase64(String value) {
        return Base64Util.decode(value);
    }
 
    public static String decodeBase64(String value, Charset charset) {
        return Base64Util.decode(value, charset);
    }
 
    public static String decodeBase64UrlSafe(String value) {
        return Base64Util.decodeUrlSafe(value);
    }
 
    public static String decodeBase64UrlSafe(String value, Charset charset) {
        return Base64Util.decodeUrlSafe(value, charset);
    }
 
    public static void closeQuietly(@Nullable Closeable closeable) {
        IoUtil.closeQuietly(closeable);
    }
 
    public static String readToString(InputStream input) {
        return IoUtil.readToString(input);
    }
 
    public static String readToString(@Nullable InputStream input, Charset charset) {
        return IoUtil.readToString(input, charset);
    }
 
    public static byte[] readToByteArray(@Nullable InputStream input) {
        return IoUtil.readToByteArray(input);
    }
 
    public static String readToString(final File file) {
        return FileUtil.readToString(file);
    }
 
    public static String readToString(File file, Charset encoding) {
        return FileUtil.readToString(file, encoding);
    }
 
    public static byte[] readToByteArray(File file) {
        return FileUtil.readToByteArray(file);
    }
 
    public static String toJson(Object object) {
        return JsonUtil.toJson(object);
    }
 
    public static byte[] toJsonAsBytes(Object object) {
        return JsonUtil.toJsonAsBytes(object);
    }
 
    public static JsonNode readTree(String jsonString) {
        return JsonUtil.readTree(jsonString);
    }
 
    public static JsonNode readTree(InputStream in) {
        return JsonUtil.readTree(in);
    }
 
    public static JsonNode readTree(byte[] content) {
        return JsonUtil.readTree(content);
    }
 
    public static JsonNode readTree(JsonParser jsonParser) {
        return JsonUtil.readTree(jsonParser);
    }
 
    public static <T> T readJson(byte[] bytes, Class<T> valueType) {
        return (T) JsonUtil.parse(bytes, valueType);
    }
 
    public static <T> T readJson(String jsonString, Class<T> valueType) {
        return (T) JsonUtil.parse(jsonString, valueType);
    }
 
    public static <T> T readJson(InputStream in, Class<T> valueType) {
        return (T) JsonUtil.parse(in, valueType);
    }
 
    public static <T> T readJson(byte[] bytes, TypeReference<T> typeReference) {
        return (T) JsonUtil.parse(bytes, typeReference);
    }
 
    public static <T> T readJson(String jsonString, TypeReference<T> typeReference) {
        return (T) JsonUtil.parse(jsonString, typeReference);
    }
 
    public static <T> T readJson(InputStream in, TypeReference<T> typeReference) {
        return (T) JsonUtil.parse(in, typeReference);
    }
 
    public static String urlEncode(String source) {
        return UrlUtil.encode(source, Charsets.UTF_8);
    }
 
    public static String urlEncode(String source, Charset charset) {
        return UrlUtil.encode(source, charset);
    }
 
    public static String urlDecode(String source) {
        return StringUtils.uriDecode(source, Charsets.UTF_8);
    }
 
    public static String urlDecode(String source, Charset charset) {
        return StringUtils.uriDecode(source, charset);
    }
 
    public static String formatDateTime(Date date) {
        return DateUtil.formatDateTime(date);
    }
 
    public static String formatDate(Date date) {
        return DateUtil.formatDate(date);
    }
 
    public static String formatTime(Date date) {
        return DateUtil.formatTime(date);
    }
 
    public static String format(Object object, String pattern) {
        if (object instanceof Number) {
            DecimalFormat decimalFormat = new DecimalFormat(pattern);
            return decimalFormat.format(object);
        } else if (object instanceof Date) {
            return DateUtil.format((Date) object, pattern);
        } else {
            if (object instanceof TemporalAccessor) {
                return DateTimeUtil.format((TemporalAccessor) object, pattern);
            }
            throw new IllegalArgumentException("未支持的对象:" + object + ",格式:" + object);
        }
    }
 
    public static Date toDate(String dateStr) {
        return DateUtil.parse(dateStr, "yyyy-MM-dd");
    }
 
    public static Date toDatetime(String dateStr) {
        return DateUtil.parse(dateStr, "yyyy-MM-dd HH:mm:ss");
    }
 
    public static Date parseDate(String dateStr, String pattern) {
        return DateUtil.parse(dateStr, pattern);
    }
 
    public static Date parse(String dateStr, ConcurrentDateFormat format) {
        return DateUtil.parse(dateStr, format);
    }
 
    public static String formatDateTime(TemporalAccessor temporal) {
        return DateTimeUtil.formatDateTime(temporal);
    }
 
    public static String formatDate(TemporalAccessor temporal) {
        return DateTimeUtil.formatDate(temporal);
    }
 
    public static String formatTime(TemporalAccessor temporal) {
        return DateTimeUtil.formatTime(temporal);
    }
 
    public static LocalDateTime parseDateTime(String dateStr, DateTimeFormatter formatter) {
        return DateTimeUtil.parseDateTime(dateStr, formatter);
    }
 
    public static LocalDateTime parseDateTime(String dateStr) {
        return DateTimeUtil.parseDateTime(dateStr);
    }
 
    public static LocalDate parseDate(String dateStr, DateTimeFormatter formatter) {
        return DateTimeUtil.parseDate(dateStr, formatter);
    }
 
    public static LocalTime parseTime(String dateStr, DateTimeFormatter formatter) {
        return DateTimeUtil.parseTime(dateStr, formatter);
    }
 
    public static LocalTime parseTime(String dateStr) {
        return DateTimeUtil.parseTime(dateStr);
    }
 
    public static Duration between(Temporal startInclusive, Temporal endExclusive) {
        return Duration.between(startInclusive, endExclusive);
    }
 
    public static Duration between(Date startDate, Date endDate) {
        return DateUtil.between(startDate, endDate);
    }
 
    @Nullable
    public static <T> T convert(@Nullable Object source, Class<T> targetType) {
        return (T) ConvertUtil.convert(source, targetType);
    }
 
    @Nullable
    public static <T> T convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
        return (T) ConvertUtil.convert(source, sourceType, targetType);
    }
 
    @Nullable
    public static <T> T convert(@Nullable Object source, TypeDescriptor targetType) {
        return (T) ConvertUtil.convert(source, targetType);
    }
 
    public static MethodParameter getMethodParameter(Constructor<?> constructor, int parameterIndex) {
        return ClassUtil.getMethodParameter(constructor, parameterIndex);
    }
 
    public static MethodParameter getMethodParameter(Method method, int parameterIndex) {
        return ClassUtil.getMethodParameter(method, parameterIndex);
    }
 
    @Nullable
    public static <A extends Annotation> A getAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType) {
        return (A) AnnotatedElementUtils.findMergedAnnotation(annotatedElement, annotationType);
    }
 
    @Nullable
    public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
        return (A) ClassUtil.getAnnotation(method, annotationType);
    }
 
    @Nullable
    public static <A extends Annotation> A getAnnotation(HandlerMethod handlerMethod, Class<A> annotationType) {
        return (A) ClassUtil.getAnnotation(handlerMethod, annotationType);
    }
 
    public static <T> T newInstance(Class<?> clazz) {
        return (T) BeanUtil.instantiateClass(clazz);
    }
 
    public static <T> T newInstance(String clazzStr) {
        return (T) BeanUtil.newInstance(clazzStr);
    }
 
    @Nullable
    public static Object getProperty(@Nullable Object bean, String propertyName) {
        return BeanUtil.getProperty(bean, propertyName);
    }
 
    public static void setProperty(Object bean, String propertyName, Object value) {
        BeanUtil.setProperty(bean, propertyName, value);
    }
 
    @Nullable
    public static <T> T clone(@Nullable T source) {
        return (T) BeanUtil.clone(source);
    }
 
    @Nullable
    public static <T> T copy(@Nullable Object source, Class<T> clazz) {
        return (T) BeanUtil.copy(source, (Class<Object>) clazz);
    }
 
    public static void copy(@Nullable Object source, @Nullable Object targetBean) {
        BeanUtil.copy(source, targetBean);
    }
 
    public static void copyNonNull(@Nullable Object source, @Nullable Object targetBean) {
        BeanUtil.copyNonNull(source, targetBean);
    }
 
    @Nullable
    public static <T> T copyWithConvert(@Nullable Object source, Class<T> clazz) {
        return (T) BeanUtil.copyWithConvert(source, clazz);
    }
 
    public static <T> List<T> copy(@Nullable Collection<?> sourceList, Class<T> targetClazz) {
        return BeanUtil.copy(sourceList, (Class) targetClazz);
    }
 
    public static <T> List<T> copyWithConvert(@Nullable Collection<?> sourceList, Class<T> targetClazz) {
        return BeanUtil.copyWithConvert(sourceList, (Class) targetClazz);
    }
 
    @Nullable
    public static <T> T copyProperties(@Nullable Object source, Class<T> clazz) throws BeansException {
        return (T) BeanUtil.copyProperties(source, clazz);
    }
 
    public static <T> List<T> copyProperties(@Nullable Collection<?> sourceList, Class<T> targetClazz) throws BeansException {
        return BeanUtil.copyProperties(sourceList, (Class) targetClazz);
    }
 
    public static Map<String, Object> toMap(@Nullable Object bean) {
        return BeanUtil.toMap(bean);
    }
 
    public static <T> T toBean(Map<String, Object> beanMap, Class<T> valueType) {
        return (T) BeanUtil.toBean(beanMap, valueType);
    }
 
    public static String convertToLike(String obj) {
        return StringPool.PERCENT + obj + StringPool.PERCENT;
    }
 
    public static <T> T isEmptyDefault(T source, T df) {
        return isNotEmpty(source) ? source : df;
    }
}