List of utility methods to do String Empty to Null
String | emptyToNull(String str) empty To Null return isBlank(str) ? null : str;
|
String | emptyToNull(String str) empty To Null return isEmpty(str) ? null : str;
|
String | emptyToNull(String string) empty To Null return isNullOrEmpty(string) ? null : string;
|
String | emptyToNull(String text) empty To Null if (text != null) { if (text.trim().isEmpty()) { text = null; return text; |
String | emptyToNull(String val) empty To Null return emptyToDefault(val, null); |
String | emptyToNull(String value) empty To Null if (value.length() == 0) { return null; return value; |
String | emptyToString(String str, String returnStr) empty To String return isNotEmpty(str) ? str : returnStr;
|
boolean | isHtmlNull(String str) is Html Null if (isEmpty(str) || "null".equals(str.toLowerCase().trim())) { return true; return false; |
String | nullSafeToString(Object obj) Convert the supplied Object to a String using the following algorithm. if (obj == null) { return "null"; } else if (obj.getClass().isArray()) { if (obj.getClass().getComponentType().isPrimitive()) { if (obj instanceof boolean[]) { return Arrays.toString((boolean[]) obj); if (obj instanceof char[]) { ... |
String | nvlStr(Object o, String valueIfNull) nvl Str if (isEmpty(o)) { return valueIfNull; return o.toString(); |