All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.adchilds.util.StringUtil Maven / Gradle / Ivy

Go to download

A simple Jython wrapper to allow JVM-based projects to execute or evaluate Python scripts at runtime with ease.

There is a newer version: 2.0.1
Show newest version
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() { }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy