From dda9ed8423d5e9c354ca57a75f4915ee47084913 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Fri, 31 Jan 2014 18:57:04 +0100 Subject: [PATCH] [New] added method StringHelper.isNotEmpty() --- .../ch/eitchnet/utils/helper/StringHelper.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/ch/eitchnet/utils/helper/StringHelper.java b/src/main/java/ch/eitchnet/utils/helper/StringHelper.java index 4a8bc83aa..34b3416f1 100644 --- a/src/main/java/ch/eitchnet/utils/helper/StringHelper.java +++ b/src/main/java/ch/eitchnet/utils/helper/StringHelper.java @@ -40,6 +40,8 @@ public class StringHelper { public static final String DASH = "-"; //$NON-NLS-1$ public static final String UNDERLINE = "_"; //$NON-NLS-1$ public static final String COMMA = ","; //$NON-NLS-1$ + public static final String SEMICOLON = ";"; //$NON-NLS-1$ + public static final String COLON = ":"; //$NON-NLS-1$ private static final Logger logger = LoggerFactory.getLogger(StringHelper.class); @@ -582,6 +584,18 @@ public class StringHelper { return value == null || value.isEmpty(); } + /** + * Simply returns true if the value is neither null nor empty + * + * @param value + * the value to check + * + * @return true if the value is neither null nor empty + */ + public static boolean isNotEmpty(String value) { + return value != null && !value.isEmpty(); + } + /** *

* Parses the given string value to a boolean. This extends the default {@link Boolean#parseBoolean(String)} as it