Skip to content

Commit 8a1cf33

Browse files
committed
Introduce ObjectUtils class
1 parent 355d40a commit 8a1cf33

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package processing.app;
2+
3+
public class ObjectUtil {
4+
5+
public static boolean isNull(Object o) {
6+
return o == null;
7+
}
8+
9+
public static <T> T defaultIfEmpty(T obj, T defaultObj) {
10+
if (isNull(obj)) return defaultObj;
11+
return obj;
12+
}
13+
}

0 commit comments

Comments
 (0)