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:
parent
355d40ae76
commit
8a1cf335ad
13
app/src/processing/app/ObjectUtil.java
Normal file
13
app/src/processing/app/ObjectUtil.java
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user