@@ -11,6 +11,10 @@ public class ObjectUtils {
11
11
12
12
/**
13
13
* If the source param is null, return the default value.
14
+ * @param source maybe null object
15
+ * @param defaultValue thing to use if source is null
16
+ * @param <T> list type
17
+ * @return resulting object
14
18
*/
15
19
public static <T > List <T > defaultIfNull (List <T > source , Supplier <List <T >> defaultValue ) {
16
20
if (source == null ) {
@@ -21,6 +25,11 @@ public static <T> List<T> defaultIfNull(List<T> source, Supplier<List<T>> defaul
21
25
22
26
/**
23
27
* If the source param is null, return the default value.
28
+ * @param source maybe null object
29
+ * @param defaultValue thing to use if source is null
30
+ * @param <K> map key type
31
+ * @param <V> map value type
32
+ * @return resulting map
24
33
*/
25
34
public static <K , V > Map <K , V > defaultIfNull (Map <K , V > source , Supplier <Map <K , V >> defaultValue ) {
26
35
if (source == null ) {
@@ -31,6 +40,10 @@ public static <K, V> Map<K, V> defaultIfNull(Map<K, V> source, Supplier<Map<K, V
31
40
32
41
/**
33
42
* If the source param is null, return the default value.
43
+ * @param source maybe null object
44
+ * @param defaultValue thing to use if source is null
45
+ * @param <T> type
46
+ * @return resulting object
34
47
*/
35
48
public static <T > T defaultIfNull (T source , Supplier <T > defaultValue ) {
36
49
if (source == null ) {
@@ -41,6 +54,9 @@ public static <T> T defaultIfNull(T source, Supplier<T> defaultValue) {
41
54
42
55
/**
43
56
* Concatenate a bunch of lists.
57
+ * @param sources bunch of lists.
58
+ * @param <T> list type
59
+ * @return resulting object
44
60
*/
45
61
@ SafeVarargs
46
62
public static <T > List <T > merge (List <T >... sources ) {
0 commit comments