List of utility methods to do Type Coalesce
String | coalesce(Object... items) Find first non-null and non-empty item if (items == null) { return ""; for (Object item : items) { if (item != null && ((String) item).length() > 0) { return item.toString(); return ""; |
String | coalesce(String str1, String str2) coalesce if (str1 != null) return str1; return str2; |
String | coalesce(String... strings) returns the first not empty string {Category} StringUtil {talendTypes} String {param} string("testMe1","testMe2") strings: String. for (String s : strings) { if (s != null) { s = s.trim(); if (isEmpty(s) == false) { return s; return null; |
String | coalesce(String... strings) Same as the SQL COALESCE. for (String s : strings) { if (!isEmpty(s)) { return s; return ""; |
String | coalesce(String... vals) Returns the first non-null value in the arguments. for (String str : vals) { if (str != null) return str; return null; |
String | coalesce(String[] values) Returns first not null && not empty String from String[] for (String val : values) if (checkLen(val)) return val; return null; |
T | coalesce(T a, T b) Return the first not null objects in the list of arguments return a == null ? b : a;
|
T | coalesce(T o0, T o1) coalesce return o0 != null ? o0 : o1;
|
T | coalesce(T preferred, T alternative) Checks whether a preferred value is valid and returns an alternative value if not. return (preferred != null ? preferred : alternative);
|
T | coalesce(T value, T whenNullValue) Devuelve el mismo valor que se pasa en value salvo si es null , en cuyo caso se devuelve whenNullValue .
return value != null ? value : whenNullValue;
|