From 67d1052fd3d6e38a8761596b6a27d509fd4318e1 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Thu, 1 Oct 2015 07:59:07 +0200 Subject: [PATCH] [New] Added StringHelper.valueOrDash --- .../java/ch/eitchnet/utils/helper/StringHelper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/ch/eitchnet/utils/helper/StringHelper.java b/src/main/java/ch/eitchnet/utils/helper/StringHelper.java index ecd20775c..8f82b3487 100644 --- a/src/main/java/ch/eitchnet/utils/helper/StringHelper.java +++ b/src/main/java/ch/eitchnet/utils/helper/StringHelper.java @@ -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 *