List of usage examples for org.apache.commons.lang StringUtils isBlank
public static boolean isBlank(String str)
Checks if a String is whitespace, empty ("") or null.
From source file:hudson.plugins.blazemeter.PerformanceBuildAction.java
public String getDisplayName() { return (!StringUtils.isBlank(linkName)) ? linkName : "BlazeMeter Report"; }
From source file:com.smartitengineering.util.bean.ClasspathResource.java
public ClasspathResource(final String resourcePath) { if (StringUtils.isBlank(resourcePath) || !resourcePath.startsWith(PropertiesLocator.CLASSPATH_RESOURCE_PREFIX) || resourcePath.length() <= PropertiesLocator.CLASSPATH_RESOURCE_PREFIX.length()) { throw new IllegalArgumentException( "Resource path must begin with " + PropertiesLocator.CLASSPATH_RESOURCE_PREFIX); }/*from w w w. j ava2 s. c o m*/ this.resourcePath = resourcePath; }
From source file:com.tsp.xlcloud.xsa.ext.rr.SessionsManager.java
public RenderingSession createSession(RenderingSession renderingSession) { if (StringUtils.isBlank(renderingSession.getApplicationId())) { throw new ValidationException("applicationId field cannot be empty"); }//from w w w.ja v a2 s . co m if (StringUtils.isBlank(renderingSession.getUserId())) { throw new ValidationException("userId field cannot be empty"); } try { Runtime.getRuntime().exec(extractCommandFromRenderingSession(renderingSession)); } catch (IOException e) { throw new InternalErrorException("Error occured while calling lobby", e.getMessage()); } // TODO call bash script(s) here return renderingSession; }
From source file:de.thischwa.pmcms.view.context.object.tagtool.GenericXhtmlTagTool.java
protected GenericXhtmlTagTool(final String name) { if (StringUtils.isBlank(name)) throw new IllegalArgumentException("The name of the tag must be set!"); this.name = name; }
From source file:com.alibaba.ims.platform.dict.DictManager.java
/** * ?//w ww . jav a 2 s . co m * * @param key * @return */ public static String get(String key) { if (StringUtils.isBlank(key)) { return null; } DictElement element = getElement(key, false); return element == null ? null : element.getValue(); }
From source file:de.codesourcery.jasm16.compiler.Executable.java
public Executable(String identifier, DebugInfo debugInfo) { super(new File(identifier), ResourceType.EXECUTABLE); if (StringUtils.isBlank(identifier)) { throw new IllegalArgumentException("identifier must not be blank/null"); }//from w ww. j a va 2 s. c o m if (debugInfo == null) { throw new IllegalArgumentException("debugInfo must not be NULL."); } this.identifier = identifier; this.debugInfo = debugInfo; }
From source file:com.bxf.hradmin.common.utils.QueryParameterTransformer.java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Predicate generatePredicate(Root root, CriteriaBuilder builder, QueryParameter... queryParameters) { Predicate condition = builder.conjunction(); for (QueryParameter queryParameter : queryParameters) { Object value = queryParameter.getValue(); if (value == null || StringUtils.isBlank(value.toString())) { continue; }//from ww w . j av a2 s . c om Path path = root.get(queryParameter.getKey()); switch (queryParameter.getMode()) { case BETWEEN: Object[] values = asArray(value); if (values != null) { condition = builder.and(builder.between((Path<Comparable>) path, asComparable(values[0]), asComparable(values[1]))); } break; case GREATER_THAN: condition = builder.and(condition, builder.greaterThan((Path<Comparable>) path, asComparable(value))); break; case GREATER_EQUALS: condition = builder.and(condition, builder.greaterThanOrEqualTo((Path<Comparable>) path, asComparable(value))); break; case LESS_THAN: condition = builder.and(condition, builder.lessThan((Path<Comparable>) path, asComparable(value))); break; case LESS_EQUALS: condition = builder.and(condition, builder.lessThanOrEqualTo((Path<Comparable>) path, asComparable(value))); break; case IS_NULL: condition = builder.and(condition, builder.isNull(path)); break; case IS_NOT_NULL: condition = builder.and(condition, builder.isNotNull(path)); break; case IN: condition = builder.and(condition, path.in(asArray(value))); break; case NOT_IN: condition = builder.and(condition, builder.not(path.in(asArray(value)))); break; case LIKE: condition = builder.and(condition, builder.like(path, "%" + String.valueOf(value) + "%")); break; case NOT_LIKE: condition = builder.and(condition, builder.notLike(path, "%" + String.valueOf(value) + "%")); break; case EQUALS: condition = builder.and(condition, builder.equal(path, value)); break; case NOT_EQUALS: condition = builder.and(condition, builder.notEqual(path, value)); break; default: break; } } return condition; }
From source file:business.model.CaptchaModel.java
/** * * @param publicKey/*ww w . j a v a 2 s . com*/ * @return */ public static String GetPrivateKeyFromPublicKey(String publicKey) { try { String privateKey = keyList.get(publicKey); if (StringUtils.isBlank(privateKey)) { privateKey = AppInfoServiceClient.getInstance().getMainInfoByApiKey(publicKey).getSecretKey(); if (StringUtils.isNotBlank(privateKey)) { keyList.put(publicKey, privateKey); } } return privateKey; } catch (Exception e) { log.error(e.getMessage(), e); } return ""; }
From source file:com.smartitengineering.util.opensearch.impl.RoleImpl.java
public RoleImpl(String roleAsString) { if (StringUtils.isBlank(roleAsString)) { throw new IllegalArgumentException("Role string value can not be blank!"); }/*from w w w. j av a2s .c o m*/ this.roleAsString = roleAsString; }
From source file:hudson.plugins.blazemeter.utils.JenkinsTestListFlow.java
public JenkinsTestListFlow(BlazeMeterUtils utils, String limit) { super(utils); this.limit = (!StringUtils.isBlank(limit) & StringUtils.isNumeric(limit)) ? limit : "10000"; }