[New] added method StringHelper.isNotEmpty()

This commit is contained in:
Robert von Burg 2014-01-31 18:57:04 +01:00
parent a79c9d88ce
commit dda9ed8423
1 changed files with 14 additions and 0 deletions

View File

@ -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();
}
/**
* <p>
* Parses the given string value to a boolean. This extends the default {@link Boolean#parseBoolean(String)} as it