1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Introduce ObjectUtils class

This commit is contained in:
s17t.net 2012-08-20 00:05:02 +02:00
parent 355d40ae76
commit 8a1cf335ad

View File

@ -0,0 +1,13 @@
package processing.app;
public class ObjectUtil {
public static boolean isNull(Object o) {
return o == null;
}
public static <T> T defaultIfEmpty(T obj, T defaultObj) {
if (isNull(obj)) return defaultObj;
return obj;
}
}