List of utility methods to do Type Coalesce
E | coalesce(E... objects) Returns the first non-null object that is passed in. for (E object : objects) { if (object != null) { return object; return null; |
O | coalesce(final O... values) Returns the first non-null value in the set if (null != values) { for (O value : values) { if (null != value) { return value; return null; ... |
String | coalesce(final String... strings) coalesce for (String str : strings) { if (str != null) { return str; return null; |
T | coalesce(final T eitherThis, final T orThat) First non-null value. return eitherThis != null ? eitherThis : orThat;
|
T | coalesce(final T... argv) coalesce for (T i : argv) { if (i != null) { return i; return null; |
T | coalesce(final T... objects) Returns the first non- null object of the argument list, or null if there is no such element.
for (final T object : objects) { if (object != null) { return object; return null; |
T | coalesce(final T... ts) Returns the first non null argument given or null if non of the arguments are non null. for (final T t : ts) { if (t != null) { return t; return null; |
float | coalesce(float... p) SQL-like coalescing using isReal() for (float v : p) { if (isReal(v)) { return v; return p[p.length - 1]; |
Object | coalesce(Object src, Object defaultValue) coalesce return null != src ? src : defaultValue;
|
Object | coalesce(Object... args) Coalesce all of the arguments passed to this function and return the first non-null argument passed. for (int i = 0; i < args.length; i++) if (args[i] != null) return args[i]; return null; |