Returns either the passed in String, or if the String is empty or null , the value of defaultStr . StringUtils.defaultIfEmpty(null, "NULL") = "NULL" StringUtils.defaultIfEmpty("", "NULL") = "NULL" StringUtils.defaultIfEmpty("bat", "NULL") = "bat" @se
(String str, String defaultStr)
| 193 | * @return the passed in String, or the default |
| 194 | */ |
| 195 | public static String defaultIfEmpty(String str, String defaultStr) { |
| 196 | return StringUtils.isEmpty(str) ? defaultStr : str; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * <p>Returns either the passed in CharSequence, or if the CharSequence is |
no test coverage detected