List of usage examples for org.apache.commons.lang3 StringUtils isBlank
public static boolean isBlank(final CharSequence cs)
Checks if a CharSequence is whitespace, empty ("") or null.
StringUtils.isBlank(null) = true StringUtils.isBlank("") = true StringUtils.isBlank(" ") = true StringUtils.isBlank("bob") = false StringUtils.isBlank(" bob ") = false
From source file:com.thoughtworks.go.util.OperatingSystem.java
private static String cleanUpPythonOutput(String str) { String output = str.replaceAll("[()',]+", ""); if (StringUtils.isBlank(output)) { throw new RuntimeException("The linux distribution string is empty"); }/*from w w w . j av a2 s .c o m*/ return output; }
From source file:com.esofthead.mycollab.validator.constraints.URLValidator.java
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (!StringUtils.isBlank(value)) { return value.matches( "[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?"); } else {/*from ww w. j a v a 2s .co m*/ return true; } }
From source file:net.sourceforge.mavenhippo.model.HippoBeanClass.java
public String getFullyQualifiedName() { StringBuilder sb = new StringBuilder(); if (StringUtils.isBlank(name)) { sb.append(name);/*from ww w . java2s . co m*/ } else { sb.append(packageName).append('.').append(name); } return sb.toString(); }
From source file:com.thoughtworks.go.plugins.GoPluginManifest.java
public String getPluginNamespacePrefix() { String value = headers.get(PluginNamespace.XSD_NAMESPACE_PREFIX); if (StringUtils.isBlank(value)) { throw new RuntimeException(String.format("Value for header %s is null or empty", value)); }/* ww w .j av a 2 s. c o m*/ return value; }
From source file:com.trenako.validation.AddressValidator.java
private static boolean invalidCountry(Address a) { return StringUtils.isBlank(a.getCountry()); }
From source file:com.jxt.web.filter.agent.AgentFilterFactory.java
private AgentFilter createAgentFilter(String agentId) { if (StringUtils.isBlank(agentId)) { return SkipAgentFilter.SKIP_FILTER; }//from w w w. jav a 2 s . c om return new DefaultAgentFilter(agentId); }
From source file:ch.citux.td.util.Log.java
public static void e(Object caller, String message) { String tag = caller.getClass().getSimpleName(); if (!StringUtils.isBlank(message)) { android.util.Log.e(tag, message); }/*from w ww . j a v a 2 s. c o m*/ }
From source file:com.nesscomputing.jdbi.mapper.PrefixResultSetMapper.java
protected PrefixResultSetMapper(final String prefix) { this.prefix = StringUtils.isBlank(prefix) ? null : prefix; }
From source file:com.netsteadfast.greenstep.action.utils.SelectItemFieldCheckUtils.java
@Override public boolean check(String value) throws ControllerException { if (StringUtils.isBlank(value) || Constants.HTML_SELECT_NO_SELECT_ID.equals(value)) { return false; }//from ww w .ja v a2 s . c o m return true; }
From source file:cn.guoyukun.spring.jpa.entity.search.SearchOperator.java
private static String formatSymbol(String symbol) { if (StringUtils.isBlank(symbol)) { return symbol; }/* ww w . j av a 2 s . c om*/ return symbol.trim().toLowerCase().replace(" ", " "); }