com.github.adchilds.util.StringUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jythonscript Show documentation
Show all versions of jythonscript Show documentation
A simple Jython wrapper to allow JVM-based projects to execute or evaluate Python scripts at runtime with ease.
package com.github.adchilds.util;
/**
* Provides basic operations for {@link String}s.
*
* @author Adam Childs
* @since 0.1
*/
public class StringUtil {
/**
* Determines if the given {@link String} is null or empty.
*
* @param value the String to check
* @return true if the String is null or empty; false otherwise
*/
public static boolean isBlank(String value) {
return value == null || value.length() == 0 || value.trim().length() == 0;
}
/**
* Determines if the given {@link String} is not null or empty.
*
* @param value the String to check
* @return true if the String is not null or empty; false otherwise
*/
public static boolean isNotBlank(String value) {
return value != null && value.trim().length() > 0;
}
// Don't allow this class to be instantiated
private StringUtil() { }
}