[New] Added StringHelper.valueOrDash
This commit is contained in:
parent
363c21d30a
commit
67d1052fd3
|
@ -657,6 +657,19 @@ public class StringHelper {
|
||||||
return split;
|
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
|
* Return a pseudo unique id which is incremented on each call. The id is initialized from the current time
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue