[New] Added StringHelper.valueOrDash

This commit is contained in:
Robert von Burg 2015-10-01 07:59:07 +02:00
parent 363c21d30a
commit 67d1052fd3
1 changed files with 13 additions and 0 deletions

View File

@ -657,6 +657,19 @@ public class StringHelper {
return split;
}
/**
* If the value parameter is empty, then a {@link #DASH} is returned, otherwise the value is returned
*
* @param value
*
* @return the non-empty value, or a {@link #DASH}
*/
public static String valueOrDash(String value) {
if (isNotEmpty(value))
return value;
return DASH;
}
/**
* Return a pseudo unique id which is incremented on each call. The id is initialized from the current time
*